Skip to content

fix: deflake three tests under parallel -T1C builds - #3608

Merged
xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/parallel-build-flakes
Oct 16, 2026
Merged

xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/parallel-build-flakes

Conversation

@xzxiaoshan

Copy link
Copy Markdown
Collaborator

Why

Three Windows CI failures since the switch to parallel -T1C builds (jobs on unrelated PRs, i.e. environment flakes, not regressions):

  • WeixinChannelRuntimeTest.deliversWithTheContextTokenStoredForThePeer — NPE
  • LocalFilesystemPersonalAssistantExampleTest.localFilesystem_filesPersistAcrossCalls — MEMORY.md replaced by the model response done
  • JevContextCompactionTest via JevContextCompactionExample.runOffline — block(Duration.ofSeconds(10)) timeout

Fixes (argued from code paths, not local timing)

  • weixin: the stub server counted sends before publishing lastSend, so waitFor(sends == 1) could observe the increment inside the gap and dereference a null payload. The payload is now published first — the two volatile writes are program-ordered, so any reader that observes the count also observes the payload (JMM); the window is eliminated, not narrowed.
  • harness: the test asserted byte-stability of MEMORY.md across calls, but MEMORY.md is agent-managed — memory consolidation rewrites it asynchronously after each call (FlushTrigger.always() default), and with a stub model the "merge" output is the literal response done. The persistence demo now uses a plain user file (notes.md), which is outside the closed set of harness-managed workspace paths, so no interleaving can clobber it.
  • jev: the example stream is fully offline and deterministic; a 10s wall-clock ceiling on .block() can only fail spuriously when parallel runners starve CPU past any fixed bound. The ceiling is dropped — a real hang is still bounded and surfaced by surefire's forkedProcessTimeoutInSeconds backstop. Docs source mirror updated to match.

Verification

  • mvn -T1 -pl agentscope-extensions-channel-weixin,agentscope-harness,agentscope-examples/jev -am test -Dtest=WeixinChannelRuntimeTest,LocalFilesystemPersonalAssistantExampleTest,JevContextCompactionTest — all green (20/20, 3/3, 16/16)
  • spotless:check clean on the touched modules

- weixin: publish the send payload before counting sends; waitFor() could
  observe the increment while lastSend was still null (NPE under CPU contention)
- harness: use a plain user file in the local-filesystem example test; MEMORY.md
  is agent-managed and memory consolidation rewrites it asynchronously after calls
- jev: drop the 10s wall-clock ceiling on the deterministic offline example
  stream; real hangs stay bounded by surefire's forkedProcessTimeoutInSeconds
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@xzxiaoshan
xzxiaoshan merged commit 04fab68 into agentscope-ai:main Oct 16, 2026
7 checks passed
xzxiaoshan added a commit that referenced this pull request Oct 16, 2026
…oken presence (#3610)

Follow-up to #3608, covering the remaining failures from the parallel
-T1C CI batch. No timeout values were changed — both fixes remove
failure mechanisms rather than budgeting more time for them.

**JevTraceManagedAgentTest block timeout** (job 115705826734): the
default workspace journal is one SQLite file written per event with full
sync, connection-per-op, busy timeout 10 s — equal to the test's entire
block budget, i.e. zero headroom by construction. Under -T1C on Windows
runners, per-commit fsyncs plus AV scans of the fresh -journal files can
stall a run past 10 s; this is the same mechanism documented for
SubagentPendingToolRecoveryTest in #3602. The test validates JEV
middleware wiring on an all-stub pipeline (mocked JevClient, Flux.just
model, Mono.just sources) and never reopens state from disk, so an
InMemorySessionLogStore removes the IO mechanism outright — the pattern
applied to SharedWorkspaceSkillStagingE2ETest in #3519.

**Codecov upload failing the build** (job 114655326210): fork PRs cannot
see CODECOV_TOKEN, and Codecov rejects tokenless uploads to a protected
branch with HTTP 400, which failed the whole job. The step is now
skipped when the token is absent, and fail_ci_if_error is off so
codecov-side outages never mask the build result.
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