Repository navigation
test: deflake five single-OS CI failure classes under -T1C contention - #4274
Merged
xzxiaoshan merged 1 commit intoNov 20, 2026
Merged
Conversation
Widen deadline/latch budgets and harden polling helpers for the classes that still fail single-OS CI runs, each anchored to measured victims: - RocketMqExecutionTest: shared await 10s to 30s (agentscope-ai#4182/agentscope-ai#4192/agentscope-ai#4103 + main red run) - AgentScopeAdapterTest: turn await 5s to 30s at all sibling sites (agentscope-ai#4204/agentscope-ai#4191/agentscope-ai#4246) - WorkerRuntimeTest: 1s fixture claim leases to 30s (agentscope-ai#4219), lane latches to 30s (agentscope-ai#4224), interrupt-proof pause() helper (agentscope-ai#4255) - ChatSessionsTest.await (shared with ChatControllerTest): 30s to 120s aligned with the file's historical starvation tier (agentscope-ai#4233/agentscope-ai#4182) plus transient sqlite-lock retry during polls (agentscope-ai#4268/agentscope-ai#4163) - CommandExecutorTest.missingExitCodeIsUnknown: incidental 2s network budget to 30s; starved schedulers misclassified a deadline miss (observed under -T2C)
5 tasks done
xzxiaoshan
added a commit
to xzxiaoshan/agentscope-java
that referenced
this pull request
Nov 23, 2026
Merge main (decbe55, 41 commits) into the final-answer-gate branch and resolve: - AgentScopeAdapterTest / RocketMqExecutionTest (content conflicts): both sides widened the same await budgets for loaded CI runners — this branch (bfb7e33) with literals, main (agentscope-ai#4274) with the named TURN_DEADLINE / AWAIT_DEADLINE_SECONDS constants and waitUntil, covering every site this branch touched with equal or wider budgets. Take main's version of both files; they are now identical to main, which supersedes this branch's deflake. - ReActAgent (auto-merged): main's only change (agentscope-ai#2919) adds structured- output call/streamEvents overloads that delegate to doCall, so they run through the same gated exits. The merged file is main plus this branch's feature delta, verified line by line. Verified: mvn -T1C clean test-compile over the whole reactor (114 modules, spotless:check clean); core and harness full suites (3573 and 1918 tests, 0 failures), including ReActAgentFinalAnswerGateTest (58) and main's new ReActAgentStreamEventsStructuredOutputTest (7); core package with javadoc doclint; RocketMqExecutionTest 5/5; docs npm test 20/20 and build validation. Not introduced here — reproduced identically on main and on the pre-merge branch head on this Windows machine: AgentScopeAdapterTest nativeHarnessWorkspaceForkCopiesPrivateFilesWithoutSharingSubsequentWrites and realHarnessMemoryFinalizationReplaysRecordedSummaryAfterRestart fail (39/41 pass); `mint broken-links` reports the same 2750 internal links on main.
xzxiaoshan
added a commit
that referenced
this pull request
Nov 26, 2026
…#4435) ## Background Swept the last 125 PRs (#4434→#4239), every single-OS-failed CI run since 2026-11-19 and the main-branch push runs for `mvn -B -T1C clean verify` failures (one build OS red and the other green on the same commit = flake suspect). Four test classes still fail on current main: three fail on windows-latest only, and the fourth sits at its deadline on both OSes. All fixes are test-side only (no `src/main` changes). ## Fixes and evidence | Test class | Victims | Signature | Fix | |---|---|---|---| | `HarnessAgentStructuredOutputStreamEventsTest` | #4296, #4349, #4071, main run 44879286932 (2026-11-20 to 11-23), all windows-latest | `streamEvents(...).block(10s)` timed out at 10.2-11.3s per call; the class takes 3.7-9.6s on windows-latest when green and 1-1.5s on ubuntu | ephemeral `InMemoryThreadJournalStore` in the three workspace-backed tests (the fourth already used one) | | `HarnessAgentOverflowRecoveryTest` | #4042, #4426 (2026-11-26), both windows-latest; the journal rows were added by #4399 on 11-25 | row `[3]` (journal=true) crossed `block(30s)` at 36.3-38.1s and row `[4]` passed with 33.8s; the same rows take 0.4-1.3s on ubuntu, and main's own run 45595615922 needed 61s for the class on windows-latest | ephemeral `InMemoryThreadJournalStore` in `newAgent` | | `DashScopeMultiModalEmbeddingTest` | #4413 (2026-11-25), windows-latest | the first SDK request in the fork hit the 5s latch (7.29s elapsed); the class takes 1.4-4.2s on windows-latest even when green | first-request latch 5s→15s | | `AnthropicAutoConfigurationTest` | #2363, run 45137197507 (2026-11-23), windows-latest | the first gateway test crossed `block(10s)` at 15.66s; the other three take under 1s, and this one already takes 5-11s on windows-latest and 9-12s on ubuntu when green | block 10s→30s | The first two share one cause: since #4154 the default workspace journal is `SqliteJournalStorage` on Windows, which opens a JDBC connection per storage operation and commits every CAS as a durable transaction (DELETE journal, synchronous EXTRA). A journaled turn issues about 20 such writes at roughly 8ms each on a fast local disk. Neither class asserts journal persistence, so they now use the ephemeral backend the repository already documents for tests. Locally on Windows the overflow-recovery class dropped from 17.9s to 5.6s and the structured-output class from 3.2s to 1.6s. ## Constraint compliance - Happy path zero cost: the journal swap removes work, the two relaxations only move failure deadlines, and no sleeps or weakened assertions were added. - Structural hardening first: the journal swap is structural. For the two cold-start waits the structural alternative, a warm-up request before the timed section, would add a request to every run, so the deadline was relaxed instead. - Minimal widening anchored to measured data: each relaxation is 3x the deadline that was crossed, and every comment cites its victims and measured values. - No `src/main` changes. ## Observed but deliberately not fixed here - `WorkerRuntimeTest.saturatedStartsDoNotBlockRecoveryAndDrainPreservesActiveLeases` (#4294, windows-latest, 36.19s at the `renewed` latch): with the test's 4s worker lease a heartbeat delayed by more than 2.7s finds the lease already expired and fails with `Worker lease lost` instead of arriving late, so widening the latch (as #4274 did to 30s) cannot help. That latch is the only place asserting the runtime renews leases, and a longer lease would delay the first heartbeat by lease/3, so the fix needs a design decision. - `SubagentFactoryDeclarationTest.declaredFactory_persistSessionIsolatesUsers` (main run 45172445003, 2026-11-23, 31.45s) and `ChatControllerTest.httpUsesExplicitCreationAndTargetedIdempotentControls` (main run 44566773929 and #4255, both 2026-11-19): no recurrence since. - Two windows-latest hangs that ended at the 2h job timeout: `AgentSpawnToolPermissionTest` (#4305, run 44760439728) and `AgentSpawnToolPlanModeTest` (main run 45739005058 on the current head). Both classes wait with unbounded `.block()`; the root cause is not established, and the 30-minute Surefire fork timeout in the root pom did not end either run. - The cost of the Windows default journal itself (one JDBC connection and one durable transaction per storage operation) is a production concern that deserves its own `src/main` change. - Already fixed upstream, victims predate the fix: `JevEvidenceProcessorTest` (13 runs, fixed by #4346), `ChatSessionsTest`, `RocketMqExecutionTest` and `AgentScopeAdapterTest` (fixed by #4274).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Swept the last 125 PRs (#4272→#4075) for single-OS CI failures under
mvn -B -T1C clean verify(one build OS red, the other green on the same commit = flake suspect). Cross-PR repeats and main's own red run on 2026-11-19 (ubuntu, run 44516464414) pinpoints four still-broken test classes; all fixes are test-side only (nosrc/mainchanges).Fixes and evidence
RocketMqExecutionTestturn reaches SUCCEEDED did not become true within 10swhile the turn kept progressing (modelCalls complete, acks climbing, lastFailure=none) — deadline breakthrough under starvation, not a lost turnwaitUntildeadline 10s→30s (repo tier #3726/#3774)AgentScopeAdapterTestTimed out observing Turnat 6.7–8.5s elapsed; resume/recovery one step from terminalturn.await(5s)→30s at all 3 sibling sites viaTURN_DEADLINE, outergetbudgets +5s marginWorkerRuntimeTestWorker lease lostafter 2.4s — 1s claim leases expired between claim and release; (b)renewed.await(5s)missed at 6.5s while the recovery lane was healthy; (c)Interrupted sleep interrupted—WorkerRuntime.process()interrupts the calling thread on lease-renewal failure and manualtick()runs it on the test threadrelease(ZERO)+ re-claim); (b) latches 5s→30s; (c) rawThread.sleep→interrupt-proofpause()at 5 sites, mirroring the #4176 fix for the same signature inProcessRecoveryTestChatSessionsTest.await(shared withChatControllerTest)Durable database transaction failed)UNAVAILABLEstore exceptions while polling; persistent failure rethrows at the deadline, FAILED-turn fast-fail unchangedCommandExecutorTest.missingExitCodeIsUnknownConstraint compliance
pause()helper, transient-lock retry, lease decoupling from the tested invariant.src/mainchanges.Observed but deliberately not fixed here
ProcessRecoveryTest.replacementCollectsOriginalResultWithoutRepeatingEffect(feat(tools): add optional LangChain4j tool interoperability #4214:expected: 2 but was: 3): recovery-semantics race (model re-run without effect re-run after abrupt halt) — a product question for the durable recovery work, not a deadline flake.JevEvidenceProcessorTest.filterFailureIsWithheldButRankFailureFollowsScoredEvidence(fix(sandbox-kubernetes): honor per-call timeout overrides #4265: delivered[]on a 25×-slowed runner): root cause not established; single occurrence.AgentScopeAgentExecutorInputRequiredTest(feat(session): expose source metadata for incremental consumers #4157/chore(deps-dev): bump org.codehaus.mojo:exec-maven-plugin from 3.6.3 to 3.7.0 #4187/fix(asdp): renew instance liveness on heartbeat #4152 all predate fix(a2a,durable,rocketmq): fix the four flaky tests that fail unrelated builds #4176'sBaseReActAgentRunnerchange),InboxMiddlewareTest(fix(service): reuse existing Git marketplace clones #4093 predates fix(harness): preserve attachments and deliver inbox context to the next request #3738),HarnessAgentSubagentStreamEventsTest(chore(deps): bump org.codehaus.mojo:flatten-maven-plugin from 1.7.3 to 1.9.0 #4183 predates fix(harness): add explicit lifecycle management for spawned agents #2917).SkillBoxTest$UploadContainmentquartet (chore(release): start 2.0.6-SNAPSHOT development #4201/chore(release): sync 2.0.5 release notes and 2.0.6-SNAPSHOT into 2.0.x #4202/fix(harness): ignore thinking blocks in compaction summaries #4212/fix(harness): weigh media blocks realistically in TokenCounterUtil #4229): test does not exist on main (fork stack only); deterministic cross-drive path bug, not load flakiness.Also applied during review: sibling sites with the identical measured mechanism were widened in the same pass — the remaining 1s fixture claim leases in
WorkerRuntimeTest(fenced begin/update/release sequences, same #4219 signature), the start/PAUSED 5s budgets in the sameAgentScopeAdapterTestmethod as the victims, and the 5s/4s observe budgets incompleteLocalBackendRunsNativeAgentWhileManagedObserverIsBlocked.Test plan
mvn -B -T2C clean verifygreen (stricter than CI's -T1C). Locally excluded, each verified to fail identically on pristine main on this machine (Windows/git-bash) while passing on CI:JsonFileAgentStateStoreTest(symlink permissions), theagentscope-extensions-durable-sandboxtrio plusToolInSandboxExampleTest/SandboxRoundTripTest(sandbox shell heredoc incompatible with local git-bash python3), and theAgentScopeAdapterTest/ProcessRecoveryTest/HarnessExternalToolProcessRecoveryTesttrio (durable-adapter classes whose Windows runs are skipped on CI; the same named tests fail on pristine main locally).