From 420000bfdbf08a4884a46de22903f3bd01c8fb09 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Mar 2019 19:19:57 -0400 Subject: [PATCH] Account for state from other tests --- integration/test_magic_folder.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/integration/test_magic_folder.py b/integration/test_magic_folder.py index 8ae93cdbf..d2bcd739d 100644 --- a/integration/test_magic_folder.py +++ b/integration/test_magic_folder.py @@ -411,20 +411,30 @@ def test_alice_adds_files_while_bob_is_offline(reactor, request, temp_dir, magic yield util.cli(reactor, bob_node_dir, "stop") # Create a couple files in Alice's local directory. - some_files = ["foo", "bar", "baz"] + some_files = list( + (name * 3) + ".added-while-offline" + for name + in "xyz" + ) for name in some_files: with open(join(alice_magic_dir, name), "w") as f: f.write(name + " some content") - while True: + good = False + for i in range(15): status = yield util.magic_folder_cli(reactor, alice_node_dir, "status") - if status.count("good, version=0") == len(some_files) * 2: + good = status.count(".added-while-offline (36 B): good, version=0") == len(some_files) * 2 + if good: # We saw each file as having a local good state and a remote good # state. That means we're ready to involve Bob. break else: time.sleep(1.0) + assert good, ( + "Timed out waiting for good Alice state. Last status:\n{}".format(status) + ) + # Start Bob up again magic_text = 'Completed initial Magic Folder scan successfully' yield util._run_node(reactor, bob_node_dir, request, magic_text)