Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix socket test #2756

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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
12 changes: 8 additions & 4 deletions packages/transport-tcp/test/socket-to-conn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,16 @@
expect(serverTimedOut.promise).to.eventually.be.true(),

// server socket was closed for reading and writing
expect(serverClosed.promise).to.eventually.be.true(),

// client connection was closed abruptly
expect(clientError.promise).to.eventually.have.property('code', 'ECONNRESET')
expect(serverClosed.promise).to.eventually.be.true()
])

const err = await clientError.promise

// can be either error depending on platform and timing
if (err.code !== 'ECONNRESET' && err.code !== 'EPIPE') {
expect.fail('client connection did not close abruptly')
}

Check warning on line 489 in packages/transport-tcp/test/socket-to-conn.spec.ts

View check run for this annotation

Codecov / codecov/patch

packages/transport-tcp/test/socket-to-conn.spec.ts#L488-L489

Added lines #L488 - L489 were not covered by tests

// server socket should no longer be writable
expect(serverSocket.writable).to.be.false()

Expand Down
Loading