Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/test_e2e_crash.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def test_write_abandoned_during_restore_is_not_executed(self):
for i in range(200): # a journal long enough that restoring it outlasts the client's patience
self.assertEqual(sqs("CreateQueue", {"QueueName": f"filler-{i}"})[0], 200)
sh("docker", "kill", f"keepstack-{PORT}")
time.sleep(1.5) # the watcher is restoring the emulator now; writes wait
# A fixed sleep raced the watcher (#47): before it notices, writes hit the dead emulator and fail at once.
deadline = time.time() + 30
while "the emulator stopped" not in self.ks("logs").stdout and time.time() < deadline:
time.sleep(0.2)
time.sleep(0.5) # the watcher is restoring the emulator now; writes wait
with self.assertRaises((socket.timeout, TimeoutError), msg="restore finished too fast to test"):
sqs("CreateQueue", {"QueueName": "abandoned"}, timeout=1)
deadline = time.time() + 120
Expand Down
Loading