Skip to content

Commit

Permalink
speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Dec 17, 2024
1 parent 70ac53a commit a2abc0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 7 additions & 4 deletions Software/Integrationtests/tests/TestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ def setUp(self):
timeout = time.time() + 3;
poll_obj = select.poll()
poll_obj.register(self.gui.stdout, select.POLLIN)
while time.time() < timeout:
while True:
poll_result = poll_obj.poll(0)
if poll_result:
line = self.gui.stdout.readline().decode().strip()
if "Listening on port 19544" in line:
break

time.sleep(1)

if time.time() >= timeout:
self.tearDown()
raise AssertionError("Timed out waiting for SCPI server")

self.vna = libreVNA('localhost', 19544, timeout=4)
try:
self.vna.cmd("*CLS;:DEV:CONN")
Expand All @@ -34,6 +35,8 @@ def setUp(self):
raise AssertionError("Not connected")

def tearDown(self):
# make sure the GUI did not crash during the test
self.assertEqual(self.gui.poll(), None)
self.gui.send_signal(SIGINT)
try:
self.gui.wait(timeout = 3)
Expand Down
6 changes: 0 additions & 6 deletions Software/Integrationtests/tests/TestRST.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,10 @@ def test_rst_hard(self):
self.vna.cmd(f"VNA:STIM:FREQ {f_1_3}")
self.vna.cmd(f"VNA:STIM:LVL {pwr_min}")
self.vna.cmd("VNA:SWEEP POWER")

# We just configured a lot of settings, give some time to empty the output queue from the GUI to the device
time.sleep(2)

# Reset and verify all settings revert.
self.vna.cmd("*RST")

# ... and wait a little bit here again to let the changes from the RST propagate from the device and back to the GUI (otherwise we might still read wrong external reference settings for example)
time.sleep(2)

settings2 = self.query_settings()
for key, value in settings1.items():
self.assertEqual(value, settings2[key])

0 comments on commit a2abc0c

Please sign in to comment.