Skip to content

Commit 149c346

Browse files
fix: add missing return after exitWithNoMatchingRequestError in CI mode (#345)
* fix: add missing return after exitWithNoMatchingRequestError in CI mode When running tests in CI mode with no cached response, the proxy would crash with ERR_HTTP_HEADERS_SENT because exitWithNoMatchingRequestError() calls onError() (which writes headers), but then execution continued to super.performRequest() which also tries to write headers. This caused cascading test failures because the proxy process would die and subsequent tests couldn't communicate with it. This is why the 'sendAndWait throws on timeout' test is currently skipped in CI. With this fix, that test could potentially be enabled. * test: enable sendAndWait timeout test in CI Now that the harness properly returns after exitWithNoMatchingRequestError, this test can run in CI without crashing the proxy. * fix broken go test --------- Co-authored-by: Adrien Friggeri <adrien@friggeri.net>
1 parent 04521e8 commit 149c346

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

go/internal/e2e/session_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,7 @@ func TestSession(t *testing.T) {
388388
}
389389

390390
// Resume using a new client
391-
newClient := copilot.NewClient(&copilot.ClientOptions{
392-
CLIPath: ctx.CLIPath,
393-
Cwd: ctx.WorkDir,
394-
Env: ctx.Env(),
395-
})
391+
newClient := ctx.NewClient()
396392
defer newClient.ForceStop()
397393

398394
session2, err := newClient.ResumeSession(t.Context(), sessionID)

nodejs/test/e2e/session.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ describe("Send Blocking Behavior", async () => {
384384
expect(events).toContain("assistant.message");
385385
});
386386

387-
// Skip in CI - this test validates client-side timeout behavior, not LLM responses.
388-
// The test intentionally times out before receiving a response, so there's no snapshot to replay.
389-
it.skipIf(process.env.CI === "true")("sendAndWait throws on timeout", async () => {
387+
// This test validates client-side timeout behavior.
388+
// The snapshot has no assistant response since we expect timeout before completion.
389+
it("sendAndWait throws on timeout", async () => {
390390
const session = await client.createSession();
391391

392392
// Use a slow command to ensure timeout triggers before completion

test/harness/replayingCapiProxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ export class ReplayingCapiProxy extends CapturingHttpProxy {
292292
state.workDir,
293293
state.toolResultNormalizers,
294294
);
295+
return;
295296
}
296297
super.performRequest(options);
297298
} catch (err) {

0 commit comments

Comments
 (0)