[CI] 2.0.x: the harness module fails on the Windows job (18 tests, three Windows path problems)
Describe the bug
#4453 removed the agentscope-core failure from the Windows job of a 2.0.x PR. With #4454 applied, that job gets further and then fails in agentscope-harness: 1619 run, 5 failures, 13 errors. Every module that depends on the harness is skipped, and the Ubuntu job is cancelled.
The same tests fail on a Windows machine on unmodified 2.0.x (5 failures, 12 errors; the 13th error is a case that also fails sometimes without any change). On Linux the module passes: the Ubuntu job of the same run, before it was cancelled, had run it with 1619 tests and 0 failures.
So a 2.0.x PR still cannot get a green or complete CI run, and changes to the harness module are never tested by CI on this branch.
Error messages
Three separate causes, all about paths on Windows.
-
12 errors in
HarnessAgentTest(7) andSandboxFilesystemIsolationScopeExampleTest(5):SandboxException$SandboxConfigurationException: Sandbox workspace root must be an absolute path but was: C:\Users\...\agentscope-inmemory-sandbox-...\...SandboxWorkspaceRoot.normalizeonly accepts a root that starts with/. The in-memory sandbox used by these tests reports a host directory as its workspace root (InMemorySandboxClient,Files.createTempDirectory("agentscope-inmemory-sandbox-")), which is a Windows path on Windows.The version of this class that #3646 brought to
main(6ff7590a) returns the root without that check. The2.0.xbackport of the same change (30d13bd2) added it. -
1 error in
MemoryFlushSandboxIndependenceTest:MemoryFlushSandboxIndependenceTest.hostMemoryAllowsSafeUnicodeNestedNamespacesAndLegacyRoot:462 » IllegalArgument 'other' has different rootLine 462 is
Path.of("").toAbsolutePath().relativize(workspace): the same cross-driverelativizeas #4453. -
5 failures in
MemoryConsolidatorCommitGateTest:checkedUploadCannotBypassRejectingProjectWriterOnCompositeExactRoute:763 expected: <false> but was: <true> projectConfirmationUsesActualWriterNotIdenticalUpperOrLower:931 reject ==> expected: <false> but was: <true> (4 cases)An upload that these tests expect to be rejected succeeds. I have not diagnosed this one yet.
To Reproduce
On Windows, on 2.0.x with #4454 applied:
mvn -pl agentscope-harness test
Expected behavior
The harness module passes on the Windows job for 2.0.x.
Suggested fix
- For 1, accept a host-absolute root in
SandboxWorkspaceRoot.normalize(the in-memory sandbox is the one sandbox that works on a host directory), or return the root asmaindoes. - For 2, the same change as #4454: keep the directory that the test relativizes on the drive of the working directory.
- For 3, diagnose first; a rejecting project writer being bypassed on Windows may be more than a test problem.
I can take this and open a PR against 2.0.x, unless someone else wants to.
Environment
- AgentScope-Java Version:
2.0.xat50886798with #4454 (f8040af3) - Java Version: 17
- OS: Windows (GitHub
windows-latest; reproduced locally on Windows 10)
Taking this one. I'll open a PR against 2.0.x, stacked on #4454 so that its CI gets past agentscope-core and shows the harness result. Order: the two known causes first (the workspace-root check, then the relativize in the test), then the MemoryConsolidatorCommitGateTest failures, which I'll diagnose before changing anything.
Opened #4456 against 2.0.x, stacked on #4454 so that its CI shows the harness result.
The three causes are fixed, and one of them was more than a Windows problem of the tests. ProjectAwareOverlay.isWorkspacePath relied on Path.isAbsolute(); on a Windows host a path with a leading separator does not count as absolute, so /MEMORY.md, the spelling the CompositeFilesystem hands its backends, was classified as a workspace file and written to the workspace layer. The project writer was bypassed. A leading separator now counts as absolute wherever the code runs, as it already did on Linux. main has the same code but not the tests that catch it, so the bypass exists there on Windows as well.
The other two: SandboxWorkspaceRoot now accepts a drive root on every host, while still rejecting relative, drive-relative and UNC roots; and MemoryFlushSandboxIndependenceTest no longer relativizes the temp directory.
The full agentscope-harness suite on Windows goes from 5 failures and 12 errors on unmodified 2.0.x to none. In a Linux container the result is unchanged apart from the 2 added tests.
One more thing, found while verifying: a full run on Windows failed once in LocalFilesystemPersonalAssistantExampleTest.localFilesystem_filesPersistAcrossCalls, which asserts that MEMORY.md is unchanged after a call while the memory flush runs in the background. Repeating the scenario 50 times on unmodified 2.0.x changed the file once. That test now disables memory hooks; it is the last commit of the PR.