Repository navigation
Description
Summary
On Windows, HarnessAgentStructuredOutputStreamEventsTest (3 of 4 tests) and
HarnessActionObservationTest.defaultHarnessPersistsBeforePublishingSettledEvent intermittently
fail with:
java.lang.IllegalStateException: Timeout on blocking read for 10000000000 NANOSECONDS
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet
and the same error carries a suppressed cleanup chain:
Suppressed: org.junit.platform.commons.JUnitException: Failed to close extension context
Caused by: java.io.IOException: Failed to delete temp directory ...\junit-...
... .agentscope-runtime\journal.sqlite3, .agentscope-runtime\journal.sqlite3-journal
Suppressed: java.nio.file.FileSystemException: ...journal.sqlite3:
另一个程序正在使用此文件,进程无法访问。 (file in use by another process)
Failing tests observed:
| Test | Block timeout |
|---|---|
HarnessAgentStructuredOutputStreamEventsTest.msgAndStringConvenienceOverloads_delegateStructuredOutput |
10s |
HarnessAgentStructuredOutputStreamEventsTest.jsonNodeOverload_delegatesStructuredOutput |
10s |
HarnessAgentStructuredOutputStreamEventsTest.classOverload_delegatesStructuredOutput |
10s |
observation.HarnessActionObservationTest.defaultHarnessPersistsBeforePublishingSettledEvent |
20s |
Environment
- Windows 10 (reproduced locally) +
windows-latestin the CI matrix (.github/workflows/maven-ci.yml) - Module:
agentscope-harness - JDK 17/21
Reproduction rate
Fails in ~2 of 3 observed full/partial module runs; within the same test class some tests pass
while siblings time out (e.g. sandboxBackedStreamEvents_acquiresAndReleasesExactlyOncePerSubscription
passed in a run where three sibling tests timed out) — load sensitivity, not a deterministic break.
The same signature appeared independently in two separate runs.
Root cause analysis (code-level)
- Windows-only SQLite journal backend:
LocalJournalStorage.java:55-58selects
SqliteJournalStorageonly whenseparator().equals("\\")(Linux/mac use plain files). - Write cost:
SqliteJournalStorage.java:60-69opens a connection per write with
JournalMode.DELETErollback-journal,synchronous FULL/EXTRAfsync, and
busyTimeout(10_000)— a single write can take seconds under load; a cancelledblock()
can leave an in-flight write connection holdingjournal.sqlite3/journal.sqlite3-journal. - Test-side: both test classes use
@TempDir Path workspaceand
block(Duration.ofSeconds(10/20))but have no@AfterEach/agent.close()— after a
timeout nobody releases the SQLite handle. - Windows cannot delete open files, so JUnit's
@TempDircleanup throws the suppressed
FileSystemException. On Linux this surfaces only as the timeout, never as the file-lock
error — a pure Windows shape.
CI impact
windows-latest runs these tests (the durable-module skip flag does not apply here), so this
produces intermittent red CI on GitHub-hosted Windows runners (slower, and checkout/temp on
different drives).
Suggested direction (maintainer's call)
- Close the agent in these tests (
@AfterEach) so the journal handle is always released, and/or - make the stream-event tests robust for slow hosts (larger/awaitility-style block waits), and/or
- cover the Windows SQLite guard in a smaller focused unit test instead of full streaming runs —
per AGENTS.md, without weakening assertions.
Activity
k65010825-ship-it commentedon Nov 23, 2026
I'd like to investigate this on Windows. The four reported tests already use try-with-resources on current
main, so I'll start by reproducing the timeout and checking whether in-flight SQLite writes keep the journal files open after cancellation. If I can isolate the cause, I'll propose a focused regression test.blueice1986 commentedon Nov 25, 2026
Thanks for picking this up! The reproduction details (full stacks with the suppressed @tempdir cleanup chain, failure rate across runs, and the Windows-only SQLite journal mechanism at LocalJournalStorage.java:55-58 / SqliteJournalStorage.java:60-69) are all in the issue body. Happy to provide additional run logs if useful.
fix(durable): drain borrowed connections before JdbcRecordStore.close…