Skip to content

Commit

Permalink
tests:regressions: simplify assertions to avoid buffering races
Browse files Browse the repository at this point in the history
  • Loading branch information
slyon committed Jul 11, 2023
1 parent 10051e7 commit 38bf459
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions tests/integration/regressions.py
Expand Up @@ -94,14 +94,10 @@ def test_try_accept_lp1949095(self):
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
p.send_signal(signal.SIGUSR1)
out, err = p.communicate()
p.wait(10)
out, err = p.communicate(timeout=10)
self.assertEqual('', err)
self.assertNotIn('An error occurred:', out)
self.assertRegex(out.strip(), r'Do you want to keep these settings\?\n\n\n'
r'Press ENTER before the timeout to accept the new configuration\n\n\n'
r'(Changes will revert in \d+ seconds\n)+'
r'Configuration accepted\.')
self.assertIn('Configuration accepted.', out)

def test_try_reject_lp1949095(self):
with open(self.config, 'w') as f:
Expand All @@ -113,14 +109,10 @@ def test_try_reject_lp1949095(self):
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
p.send_signal(signal.SIGINT)
out, err = p.communicate()
p.wait(10)
out, err = p.communicate(timeout=10)
self.assertEqual('', err)
self.assertNotIn('An error occurred:', out)
self.assertRegex(out.strip(), r'Do you want to keep these settings\?\n\n\n'
r'Press ENTER before the timeout to accept the new configuration\n\n\n'
r'(Changes will revert in \d+ seconds\n)+'
r'Reverting\.')
self.assertIn('Reverting.', out)

def test_apply_networkd_inactive_lp1962095(self):
self.setup_eth(None)
Expand Down

0 comments on commit 38bf459

Please sign in to comment.