Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/core/__tests__/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,5 +677,8 @@ describe('oidc-client-tests', () => {
const http = new HttpClient('actions/oidc-client')
const res = await http.get(getTokenEndPoint())
expect(res.message.statusCode).toBe(200)
// Consume the response to close the socket
await res.readBody()
res.message.destroy()
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await res.readBody() should already fully drain the response and allow the underlying socket to close; calling res.message.destroy() afterwards is redundant and makes the intent a bit unclear. Consider dropping the destroy() (or updating the comment if you intentionally want to abort instead of just consuming).

Suggested change
res.message.destroy()

Copilot uses AI. Check for mistakes.
})
})
2 changes: 2 additions & 0 deletions packages/http-client/__tests__/basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ describe('basics', () => {
'https://postman-echo.com/get'
)
expect(res.message.statusCode).toBe(200)
// Consume the response to close the socket
res.message.destroy()
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the response is being consumed, but res.message.destroy() actually aborts the stream. For a HEAD request you can drain/consume cleanly by awaiting res.readBody() (it should resolve to an empty string) and avoid calling destroy(), which keeps the intent clear and matches the pattern used in other tests in this file.

Suggested change
res.message.destroy()
await res.readBody()

Copilot uses AI. Check for mistakes.
})

it('does basic http delete request', async () => {
Expand Down
Loading