Skip to content

Commit

Permalink
tests/test_remote: add test_exporter_coordinator_becomes_unreachable
Browse files Browse the repository at this point in the history
A previous commit added a test for exporter startup with an unreachable
coordinator. Now also add a test simulating a dissappearing coordinator
during operation. The exporter should notice the coordinator
disappearing and should exit with exitcode 100. This way systemd can
try restarting the exporter regularly until the coordinator is available
again.

Signed-off-by: Bastian Krause <[email protected]>
  • Loading branch information
Bastian-Krause committed Jul 17, 2024
1 parent 4e2f71d commit 64fb1c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ def test_exporter_start_coordinator_unreachable(monkeypatch, tmpdir):
spawn.expect(pexpect.EOF)
spawn.close()
assert spawn.exitstatus == 100, spawn.before

def test_exporter_coordinator_becomes_unreachable(coordinator, exporter):
coordinator.suspend_tree()

exporter.spawn.expect(pexpect.EOF, timeout=30)
exporter.spawn.close()
assert exporter.exitstatus == 100

coordinator.resume_tree()

0 comments on commit 64fb1c6

Please sign in to comment.