From 5a3d36904c96608fa78e2a84badb7c8b45cc5c48 Mon Sep 17 00:00:00 2001 From: DanS Date: Wed, 14 Oct 2026 12:36:43 -0500 Subject: [PATCH] test(litebe): make the retire test deterministic under the change-gate The change-gated refresh worker only runs `balance` on a full-refresh cycle, so testLiteWalletControllerRetire could no longer reliably park the worker inside a blocked `balance` (it passed only by timing). Bump the fake scanned height to force a full-refresh cycle, which enters the now-blocked `balance` deterministically. Co-Authored-By: Claude Opus 4.8 --- tests/test_phase4.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_phase4.cpp b/tests/test_phase4.cpp index 83b7309..8f2c7dd 100644 --- a/tests/test_phase4.cpp +++ b/tests/test_phase4.cpp @@ -12139,6 +12139,9 @@ void testLiteWalletControllerRetire() EXPECT_TRUE(c->importKeyAsync("secret-extended-key-x", [&](const LiteImportResult& r) { ++n2; ok2 = r.ok; })); const long entered = dragonx::test::g_liteFakeBalanceEntered.load(); dragonx::test::g_liteFakeBlockBalance = true; + // The refresh worker change-gates (C23): it only runs `balance` on a full-refresh cycle. Bump the + // scanned height so the gate forces a DoFull, which enters the now-blocked `balance` and parks there. + dragonx::test::g_liteFakeHeight = dragonx::test::g_liteFakeHeight.load() + 1; for (int i = 0; i < 1000 && dragonx::test::g_liteFakeBalanceEntered.load() == entered; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(5)); EXPECT_TRUE(dragonx::test::g_liteFakeBalanceEntered.load() > entered);