aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/tcp-server.test.ts
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-01-03 09:06:45 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-02 23:06:45 -0800
commit7edaf736a22d5d5b344932f1a290558cec5eb7fa (patch)
tree9ae49366cea441add4173ddde572d79c4f55a5f0 /test/bun.js/tcp-server.test.ts
parentc770db7d52408bba14fe0d531b7b6bfae7b32cbd (diff)
downloadbun-7edaf736a22d5d5b344932f1a290558cec5eb7fa.tar.gz
bun-7edaf736a22d5d5b344932f1a290558cec5eb7fa.tar.zst
bun-7edaf736a22d5d5b344932f1a290558cec5eb7fa.zip
[socket] handle `connectError` (#1705)
assorted clean-ups & fixes
Diffstat (limited to 'test/bun.js/tcp-server.test.ts')
-rw-r--r--test/bun.js/tcp-server.test.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/bun.js/tcp-server.test.ts b/test/bun.js/tcp-server.test.ts
index 65dd069a6..3f008a16b 100644
--- a/test/bun.js/tcp-server.test.ts
+++ b/test/bun.js/tcp-server.test.ts
@@ -96,17 +96,12 @@ it("echo server 1 on 1", async () => {
await Promise.all([prom, clientProm, serverProm]);
server.stop();
server = serverData = clientData = undefined;
- Bun.gc(true);
})();
+});
+it("should not leak memory", () => {
// Tell the garbage collector for sure that we're done with the sockets
- await new Promise((resolve, reject) => {
- setTimeout(() => {
- Bun.gc(true);
- resolve(undefined);
- }, 1);
- });
-
+ Bun.gc(true);
// assert we don't leak the sockets
// we expect 1 because that's the prototype / structure
expect(JSC.heapStats().objectTypeCounts.TCPSocket).toBe(1);