Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
update @trufflesuite/uws-js-unofficial to 20.4.0-unofficial.4. Added …
Browse files Browse the repository at this point in the history
…a test to ensure no new connections are accepted while closing, and other persistent connections are still open
  • Loading branch information
jeffsmale90 committed Mar 23, 2022
1 parent 54b38e0 commit 8973873
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/chains/ethereum/ethereum/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/ethereum/ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"ws": "8.2.3"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.3",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.4",
"@types/encoding-down": "5.0.0",
"@types/fs-extra": "9.0.2",
"@types/keccak": "3.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/chains/filecoin/filecoin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/filecoin/filecoin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@filecoin-shipyard/lotus-client-schema": "2.0.0",
"@ganache/filecoin-options": "0.1.4",
"@ganache/utils": "0.1.4",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.3",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.4",
"@types/bn.js": "5.1.0",
"@types/deep-equal": "1.0.1",
"@types/levelup": "4.3.0",
Expand Down
6 changes: 3 additions & 3 deletions src/chains/tezos/tezos/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/tezos/tezos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"emittery": "0.10.0"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.3",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.4",
"@types/mocha": "9.0.0",
"cheerio": "1.0.0-rc.3",
"cross-env": "7.0.3",
Expand Down
6 changes: 3 additions & 3 deletions src/packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@ganache/options": "0.1.4",
"@ganache/tezos": "0.1.4",
"@ganache/utils": "0.1.4",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.3",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.4",
"aggregate-error": "3.1.0",
"emittery": "0.10.0",
"promise.allsettled": "1.0.4"
Expand Down
40 changes: 37 additions & 3 deletions src/packages/core/tests/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ describe("server", () => {
}
});

it("closes even if an http connection with keep-alive is open", async () => {
it("closes even if a persistent http connection is open", async () => {
const agent = new http.Agent({
keepAlive: true
});
Expand All @@ -409,12 +409,46 @@ describe("server", () => {
// open the http connection
await post("localhost", port, jsonRpcJson, agent);

s.close();
await s.close();
// a request is required in order to actually close the connection
await post("localhost", port, jsonRpcJson, agent);

// connection has now closed, allowing ganache to close
await assert.rejects(post("localhost", port, jsonRpcJson, agent));
await assert.rejects(post("localhost", port, jsonRpcJson, agent), {
code: "ECONNREFUSED"
});
} finally {
teardown();
}
});

it("refuses new connections when waiting on persistent connections to close", async () => {
const agent = new http.Agent({
keepAlive: true
});

await setup();
const jsonRpcJson: any = {
jsonrpc: "2.0",
id: "1",
method: "eth_block_number",
params: []
};

try {
// open the http connection
await post("localhost", port, jsonRpcJson, agent);

await s.close();

// this connection is on a different connection, so should fail
await assert.rejects(post("localhost", port, jsonRpcJson), {
code: "ECONNREFUSED"
});

// a request is required in order to actually close the connection
await post("localhost", port, jsonRpcJson, agent);

} finally {
teardown();
}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"seedrandom": "3.0.5"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.3",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.4",
"@types/mocha": "9.0.0",
"@types/seedrandom": "3.0.1",
"cross-env": "7.0.3",
Expand Down

0 comments on commit 8973873

Please sign in to comment.