aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-01-05 14:11:42 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-01-05 14:10:07 +0100
commitfac810bb0a524e79014882f8fc694efade35de9f (patch)
tree36514e50abbadf511a169f58073a6eed67653d9c
parent296e88225096125b08665b97715c5b8ebb1d28ec (diff)
test: Fix feature_startupnotify intermittent issue
-rwxr-xr-xtest/functional/feature_startupnotify.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/feature_startupnotify.py b/test/functional/feature_startupnotify.py
index f4672a2705..ff5272b281 100755
--- a/test/functional/feature_startupnotify.py
+++ b/test/functional/feature_startupnotify.py
@@ -29,9 +29,14 @@ class StartupNotifyTest(BitcoinTestFramework):
self.wait_until(lambda: os.path.exists(tmpdir_file))
self.log.info("Test -startupnotify is executed once")
- with open(tmpdir_file, "r", encoding="utf8") as f:
- file_content = f.read()
- assert_equal(file_content.count(FILE_NAME), 1)
+
+ def get_count():
+ with open(tmpdir_file, "r", encoding="utf8") as f:
+ file_content = f.read()
+ return file_content.count(FILE_NAME)
+
+ self.wait_until(lambda: get_count() > 0)
+ assert_equal(get_count(), 1)
self.log.info("Test node is fully started")
assert_equal(self.nodes[0].getblockcount(), 200)