mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 15:29:14 +01:00
test: Fix feature_startupnotify intermittent issue
This commit is contained in:
@@ -29,9 +29,14 @@ class StartupNotifyTest(BitcoinTestFramework):
|
|||||||
self.wait_until(lambda: os.path.exists(tmpdir_file))
|
self.wait_until(lambda: os.path.exists(tmpdir_file))
|
||||||
|
|
||||||
self.log.info("Test -startupnotify is executed once")
|
self.log.info("Test -startupnotify is executed once")
|
||||||
with open(tmpdir_file, "r", encoding="utf8") as f:
|
|
||||||
file_content = f.read()
|
def get_count():
|
||||||
assert_equal(file_content.count(FILE_NAME), 1)
|
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")
|
self.log.info("Test node is fully started")
|
||||||
assert_equal(self.nodes[0].getblockcount(), 200)
|
assert_equal(self.nodes[0].getblockcount(), 200)
|
||||||
|
|||||||
Reference in New Issue
Block a user