test: defang two flaky tests on main CI
agent.integration "creates an autonomous live turn" — the prompt asked Claude to use a `Task` tool that doesn't exist in the SDK (Paseo synthesizes Task entries from sidechain notifications, but Claude can't invoke it). Haiku non-deterministically refused or complied. Switch to Bash with run_in_background, matching the deterministic claude-autonomous-wake-simple.real.e2e variant — same autonomous-wake mechanism is exercised. schedule/service "defaults new-agent modeId to provider's unattended mode" — afterEach raced AgentStorage's background snapshot persist, producing intermittent ENOTEMPTY rmdirs. Drain pending writes with agentStorage.flush() before rm.
This commit is contained in:
@@ -378,9 +378,9 @@ describe("ClaudeAgentSession integration", () => {
|
|||||||
streamSession(
|
streamSession(
|
||||||
handle.session,
|
handle.session,
|
||||||
[
|
[
|
||||||
"Use the Task tool to start a background sub-agent.",
|
"Use the Bash tool with run_in_background.",
|
||||||
"In that task, run the Bash command exactly: sleep 3 && echo BACKGROUND_DONE",
|
"Run exactly: sleep 3",
|
||||||
"Do not wait for task completion.",
|
"Do not wait for the task result.",
|
||||||
"Reply immediately with exactly: SPAWNED",
|
"Reply immediately with exactly: SPAWNED",
|
||||||
`When the background task completes later, reply with exactly: ${autonomousWakeToken}`,
|
`When the background task completes later, reply with exactly: ${autonomousWakeToken}`,
|
||||||
].join(" "),
|
].join(" "),
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ describe("ScheduleService", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
|
// Drain pending background persists before deleting the dir to avoid
|
||||||
|
// ENOTEMPTY races when AgentManager flushes a snapshot mid-cleanup.
|
||||||
|
await agentStorage.flush();
|
||||||
await rm(tempDir, { recursive: true, force: true });
|
await rm(tempDir, { recursive: true, force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user