diff options
author | 2022-12-17 15:41:47 -0800 | |
---|---|---|
committer | 2022-12-17 15:41:47 -0800 | |
commit | feea8824f1da05a43f602e8f9f94ff1862c848d0 (patch) | |
tree | 0b07b0f02539d99efa500895f6d2a0a69e8514c6 /test/bun.js/body-stream.test.ts | |
parent | 028e48ed972fa0a05388feab4c6874baab0331c2 (diff) | |
download | bun-feea8824f1da05a43f602e8f9f94ff1862c848d0.tar.gz bun-feea8824f1da05a43f602e8f9f94ff1862c848d0.tar.zst bun-feea8824f1da05a43f602e8f9f94ff1862c848d0.zip |
Delete Oniguruma (#1625)
* Update .gitmodules
* Delete oniguruma
* Delete Oniguruma
* Make this test less flaky
* :scissors:
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'test/bun.js/body-stream.test.ts')
-rw-r--r-- | test/bun.js/body-stream.test.ts | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/bun.js/body-stream.test.ts b/test/bun.js/body-stream.test.ts index bc6dc10f8..0a44246b0 100644 --- a/test/bun.js/body-stream.test.ts +++ b/test/bun.js/body-stream.test.ts @@ -5,7 +5,7 @@ import { readFileSync } from "fs"; // afterEach(() => Bun.gc(true)); -var port = 4020; +var port = 4021; { const BodyMixin = [ @@ -175,12 +175,13 @@ var port = 4020; } } +var existingServer; async function runInServer( opts: ServeOptions, cb: (url: string) => void | Promise<void>, ) { var server; - server = Bun.serve({ + const handler = { ...opts, port: port++, fetch(req) { @@ -197,17 +198,20 @@ async function runInServer( console.log(err.stack); throw err; }, - }); + }; + + if (!existingServer) { + existingServer = server = Bun.serve(handler); + } else { + server = existingServer; + server.reload(handler); + } + try { await cb(`http://${server.hostname}:${server.port}`); } catch (e) { throw e; } finally { - server && server.stop(); - server = undefined; - if (port > 4200) { - port = 4120; - } } } |