fix(e2e): give factory hook tests time for the Worker turn · Entire

fix(e2e): give factory hook tests time for the Worker turn

a3db5cemain·

pfleidi·2w ago·1 file·+9 added/-4 removed

Droid's prompt pattern matches the always-visible input box, so WaitFor can return mid-turn; the 10s file wait then expires while the Worker is still executing (60-120s turns on CI). Widen the file and rewind-point waits to absorb the Worker runtime.

Sessions

63e9c5af67f1View transcript

[?
Debug E2E Test Timing IssuesClaude Code·Opus 4.8[1m]·4 steps](/content/gh/entireio/cli/session/58280a70-c670-4b2d-a1c8-80439ef7460d#timeline-63e9c5af67f1/index.html)

Changes

1

30 unmodified lines

31
32
33
34
34
35
36
37
38
36
39
40
41
42
17 unmodified lines

60
61
62
60
61
63
64
65
66
67
68
69

30 unmodified lines

"Can you run a Worker that inspects this code and comes up with a short summary about what it is about? Have the Worker write that summary to docs/factory-hook-check.md as one short paragraph followed by exactly 3 bullet points. Do not create or edit the file in the main agent process. Only the Worker should write the file. Do not commit. Do not ask for confirmation."
        s.WaitFor(t, session, s.Agent.PromptPattern(), 90*time.Second)

testutil.WaitForFileExists(t, s.Dir, "docs/factory-hook-check.md", 10*time.Second)
    // WaitFor can return while droid is still working: the input box's
    // "> Enter to steer" matches the prompt pattern even mid-turn, so the
    // file wait must absorb the Worker's runtime (60-120s turns on CI).
    testutil.WaitForFileExists(t, s.Dir, "docs/factory-hook-check.md", 90*time.Second)

waitForTaskRewindPoint(t, s.Dir, 15*time.Second)
    waitForTaskRewindPoint(t, s.Dir, 30*time.Second)
    })
}

17 unmodified lines

"Can you run a Worker that inspects this code and writes its findings to docs/factory-prehook-worker.md as one short paragraph followed by exactly 3 bullet points? Do not read, modify, or mention docs/factory-preexisting-human-note.md. Do not create or edit the file in the main agent process. Only the Worker should write docs/factory-prehook-worker.md. Do not commit. Do not ask for confirmation."
        s.WaitFor(t, session, s.Agent.PromptPattern(), 90*time.Second)

testutil.WaitForFileExists(t, s.Dir, "docs/factory-prehook-worker.md", 10*time.Second)
    waitForTaskRewindPoint(t, s.Dir, 15*time.Second)
    // See TestFactoryTaskCheckpointExistsBeforeCommit: the file wait must
    // absorb the Worker's runtime because WaitFor can return mid-turn.
    testutil.WaitForFileExists(t, s.Dir, "docs/factory-prehook-worker.md", 90*time.Second)
    waitForTaskRewindPoint(t, s.Dir, 30*time.Second)

s.Git(t, "add", "docs/factory-prehook-worker.md")
    s.Git(t, "commit", "-m", "Add factory worker checkpoint regression fixtures")

Me2e/tests/factory_hooks_test.go+9/-4