From f90bb537c400b918dcfff5cec984018c1fe9bf57 Mon Sep 17 00:00:00 2001 From: xzxiaoshan <365384722@qq.com> Date: Sat, 17 Oct 2026 22:13:56 +0800 Subject: [PATCH] fix: deflake Weixin standby takeover test under parallel -T1C builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Widen the takeover observation in WeixinLeaseLifecycleTest from 3s to 10s. The awaited chain is convergent by construction — the consumer loop retries while it runs and every step is bounded (one standby retry sleep of leaseMs/3, three localhost HTTP round trips, one boundedElastic hop) — so only the wall-clock window can fail. Under -T1C contention those steps stall for whole seconds at a time; the 172156 CI run missed the 3s window with the loop healthy (no retry warnings). 10s keeps headroom under the class @Timeout(20) fuse and adds zero time to the happy path, which exits on the latch. --- .../channel/weixin/WeixinLeaseLifecycleTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agentscope-extensions/agentscope-extensions-channel/agentscope-extensions-channel-weixin/src/test/java/io/agentscope/extensions/channel/weixin/WeixinLeaseLifecycleTest.java b/agentscope-extensions/agentscope-extensions-channel/agentscope-extensions-channel-weixin/src/test/java/io/agentscope/extensions/channel/weixin/WeixinLeaseLifecycleTest.java index e2b0671570..649eea6486 100644 --- a/agentscope-extensions/agentscope-extensions-channel/agentscope-extensions-channel-weixin/src/test/java/io/agentscope/extensions/channel/weixin/WeixinLeaseLifecycleTest.java +++ b/agentscope-extensions/agentscope-extensions-channel/agentscope-extensions-channel-weixin/src/test/java/io/agentscope/extensions/channel/weixin/WeixinLeaseLifecycleTest.java @@ -145,7 +145,12 @@ void standbyKeepsTryingAndTakesOverWithoutConfigurationChange() throws Exception "the standby instance never attempted to acquire the lease"); assertEquals(1, entered.getCount()); store.releaseLease("account", owner); - assertTrue(sent.await(3, TimeUnit.SECONDS)); + // Takeover cannot get stuck: the consumer loop retries while it runs, and every step is + // bounded — one standby retry sleep (leaseMs/3 = 500ms), three localhost HTTP round trips + // and one boundedElastic hop. Under -T1C contention those steps stall for whole seconds + // at a time (CI missed a 3s window here with the loop healthy), so the observation needs + // load headroom; @Timeout(20) remains the hard fuse and the happy path exits on the latch. + assertTrue(sent.await(10, TimeUnit.SECONDS)); assertEquals(1, sends.get()); }