Skip to content

Commit

Permalink
Fix: import stomp in the function scope (#14703)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtojek authored Nov 22, 2019
1 parent 690b78c commit 9a9408b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x-pack/metricbeat/tests/system/test_activemq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import string
import sys

import stomp
import unittest

from xpack_metricbeat import XPackTest
Expand Down Expand Up @@ -39,12 +38,14 @@ def destination_metrics_collected(self, destination_type, destination_name):
return False

def verify_destination_metrics_collection(self, destination_type):
from stomp import Connection

self.render_config_template(modules=[self.get_activemq_module_config(destination_type)])
proc = self.start_beat(home=self.beat_path)

destination_name = ''.join(random.choice(string.ascii_lowercase) for i in range(10))

conn = stomp.Connection([self.get_stomp_host_port()])
conn = Connection([self.get_stomp_host_port()])
conn.start()
conn.connect(wait=True)
conn.send('/{}/{}'.format(destination_type, destination_name), 'first message')
Expand Down

0 comments on commit 9a9408b

Please sign in to comment.