Skip to content

Commit 8462aeb

Browse files
tests/test_remote: add test_exporter_coordinator_becomes_unreachable
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]>
1 parent df8df52 commit 8462aeb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_remote.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ def test_exporter_start_coordinator_unreachable(monkeypatch, tmpdir):
3535
spawn.expect(pexpect.EOF)
3636
spawn.close()
3737
assert spawn.exitstatus == 100, spawn.before
38+
39+
def test_exporter_coordinator_becomes_unreachable(coordinator, exporter):
40+
coordinator.suspend_tree()
41+
42+
exporter.spawn.expect(pexpect.EOF, timeout=30)
43+
exporter.spawn.close()
44+
assert exporter.exitstatus == 100
45+
46+
coordinator.resume_tree()

0 commit comments

Comments
 (0)