From 09813cffcfbce42d5b67d46b84bbbcd24a35ea64 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 22 Mar 2023 17:45:13 +0000 Subject: [PATCH 1/2] Merge bitcoin/bitcoin#27297: test: Remove unused Check* default constructors fae349076db03ddfbf23c5d828368d538b5d52d5 test: Remove unused Check* default constructors (MarcoFalke) Pull request description: They are no longer needed after the removal of `swap`, see https://github.com/bitcoin/bitcoin/pull/26749#discussion_r1144532693 Also, flatten a redundant `if` check. ACKs for top commit: hebasto: ACK fae349076db03ddfbf23c5d828368d538b5d52d5 Tree-SHA512: c0bc0c16b5df0f16fc25e18d2414a2a3c4769da1aa30d53f8d267bc2e97dd79a0296db94c1e49cd1ca89bd42275d8c462f7bf47f03f105dfe867ebea6563454b --- src/test/checkqueue_tests.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp index a338511c9fad..3fecdf8b85d4 100644 --- a/src/test/checkqueue_tests.cpp +++ b/src/test/checkqueue_tests.cpp @@ -58,7 +58,6 @@ struct FakeCheckCheckCompletion { struct FailingCheck { bool fails; FailingCheck(bool _fails) : fails(_fails){}; - FailingCheck() : fails(true){}; bool operator()() const { return !fails; @@ -74,7 +73,6 @@ struct UniqueCheck { static std::unordered_multiset results GUARDED_BY(m); size_t check_id; UniqueCheck(size_t check_id_in) : check_id(check_id_in){}; - UniqueCheck() : check_id(0){}; bool operator()() { LOCK(m); @@ -95,7 +93,6 @@ struct MemoryCheck { { return true; } - MemoryCheck() = default; MemoryCheck(const MemoryCheck& x) { // We have to do this to make sure that destructor calls are paired @@ -182,9 +179,7 @@ static void Correct_Queue_range(std::vector range) control.Add(vChecks); } BOOST_REQUIRE(control.Wait()); - if (FakeCheckCheckCompletion::n_calls != i) { - BOOST_REQUIRE_EQUAL(FakeCheckCheckCompletion::n_calls, i); - } + BOOST_REQUIRE_EQUAL(FakeCheckCheckCompletion::n_calls, i); } small_queue->StopWorkerThreads(); } From 7330bfba7b668a35cb83aba96ba4c2b6db6782d4 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Thu, 9 May 2024 18:31:03 -0400 Subject: [PATCH 2/2] Merge bitcoin/bitcoin#30006: test: use sleepy wait-for-log in reindex readonly fd6a7d3a13d89d74e161095b0e9bd3570210a40c test: use sleepy wait-for-log in reindex readonly (Matthew Zipkin) Pull request description: Also rename the busy wait-for-log method to prevent recurrence. See https://github.com/bitcoin/bitcoin/pull/27039#discussion_r1532578152 ACKs for top commit: maflcko: utACK fd6a7d3a13d89d74e161095b0e9bd3570210a40c achow101: ACK fd6a7d3a13d89d74e161095b0e9bd3570210a40c tdb3: ACK for fd6a7d3a13d89d74e161095b0e9bd3570210a40c rkrux: ACK [fd6a7d3](https://github.com/bitcoin/bitcoin/pull/30006/commits/fd6a7d3a13d89d74e161095b0e9bd3570210a40c) Tree-SHA512: 7ff0574833df1ec843159b35ee88b8bb345a513ac13ed0b72abd1bf330c454a3f9df4d927871b9e3d37bfcc07542b06ef63acef8e822cd18499adae8cbb0cda8 --- test/functional/feature_init.py | 2 +- test/functional/test_framework/test_node.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/feature_init.py b/test/functional/feature_init.py index ce12319933de..d468ceb775ae 100755 --- a/test/functional/feature_init.py +++ b/test/functional/feature_init.py @@ -87,7 +87,7 @@ def check_clean_start(): for terminate_line in lines_to_terminate_after: self.log.info(f"Starting node and will exit after line {terminate_line}") - with node.wait_for_debug_log([terminate_line]): + with node.busy_wait_for_debug_log([terminate_line]): node.start(extra_args=['-txindex=1', '-blockfilterindex=1', '-coinstatsindex=1']) self.log.debug("Terminating node after terminate line was found") sigterm_node() diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index cbe42cd1de88..cb9da3959df5 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -490,7 +490,7 @@ def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2): self._raise_assertion_error('Expected messages "{}" does not partially match log:\n\n{}\n\n'.format(str(expected_msgs), print_log)) @contextlib.contextmanager - def wait_for_debug_log(self, expected_msgs, timeout=60): + def busy_wait_for_debug_log(self, expected_msgs, timeout=60): """ Block until we see a particular debug log message fragment or until we exceed the timeout. Return: