Skip to content

fix: deflake Weixin standby takeover test under parallel -T1C builds - #3629

Merged
xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/build-error-172156
Oct 17, 2026
Merged

xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/build-error-172156

Conversation

@xzxiaoshan

Copy link
Copy Markdown
Collaborator

Deflakes the ubuntu failure from CI batch 172156 (run on current main, PR #3442).

WeixinLeaseLifecycleTest.standbyKeepsTryingAndTakesOverWithoutConfigurationChange (ubuntu)

sent.await(3s) returned false: after the lease was released, the standby did not finish takeover — acquire, notifyStart, getupdates, dispatch, sendmessage — within 3 seconds.

  • The chain is convergent by construction: the consumer loop retries forever while it runs, and every step is bounded — one standby retry sleep (leaseMs/3 = 500ms), three localhost HTTP round trips, one boundedElastic hop. No interleaving loses the takeover; only the wall-clock observation window can fail.
  • The CI timeline shows pure -T1C starvation, not a stuck loop: the test method itself stalled ~3.1s before channel.start() even logged, and the takeover window expired with zero retry/warn lines from the consumer loop.
  • Restructuring cannot remove this wall-clock dependence (the loop's sleep and hops need real time), and shrinking leaseMs would make the lease likelier to expire mid-takeover during a stall — structurally worse.
  • Fix: widen the observation from 3s to 10s (~3x the failed budget). Worst case stays ~6.7s under the class-level @Timeout(20) fuse even including the observed pre-start stall. Latch-based, so the happy path is unchanged — the same CI run's sibling test finished its whole flow in 2.1s.

ChatSessionsTest.queuedTasksAreDistinctAndSteeringStaysInCurrentExecution (windows)

Already fixed on main; no change needed. The failing run (Oct 11) built on base da3b867, which predates #3602 — where this exact await was widened from the 15s default to 60s ("Two durable turns with streamed output can exceed 15 seconds on Windows runners") — and #3616's snapshot consistency fix. The failure signature matches: the timeout snapshot held one completed turn while the queued turn had no run/start fact yet, i.e. turn two had not started within 15s under load.

Testing

  • mvn -pl agentscope-extensions/agentscope-extensions-channel/agentscope-extensions-channel-weixin test — 71 pass / 1 skipped, same as CI
  • WeixinLeaseLifecycleTest ×8 under 8-process CPU load — all green, ~5.9s per class run under load
  • spotless:check clean

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.
@xzxiaoshan
xzxiaoshan merged commit c3959ce into agentscope-ai:main Oct 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants