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!: use node v20 throughout monorepo #5730

Merged
merged 27 commits into from
Jul 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4c1616b
chore!: use node 20 throughout monorepo
wemeetagain Jul 5, 2023
a899503
Add yarn.lock
wemeetagain Jul 6, 2023
6ce7718
Revert @types/node change
wemeetagain Jul 6, 2023
9ff2e2a
Fix ts-node usage
wemeetagain Jul 6, 2023
1d5c3c1
Add missed files
wemeetagain Jul 7, 2023
c153a27
Merge branch 'unstable' into cayman/node-20
wemeetagain Jul 7, 2023
7b70892
Remove more ts-node-esm
wemeetagain Jul 7, 2023
84e44b8
Update cross-fetch dependency
wemeetagain Jul 11, 2023
9494c71
Merge branch 'unstable' into cayman/update-libp2p
wemeetagain Jul 11, 2023
0c47758
Update @types/node to 20.4.2
nflaig Jul 14, 2023
8354bd4
Use node version 20.4 in CI
nflaig Jul 14, 2023
b38bee6
Revert "Use node version 20.4 in CI"
nflaig Jul 14, 2023
d296b2f
skip tests that break in CI
wemeetagain Jul 14, 2023
e1f07be
Update Dockerfile
wemeetagain Jul 14, 2023
d954b96
Check code ECONNRESET in Lighthouse health response
nflaig Jul 14, 2023
409d8ad
Revert "Check code ECONNRESET in Lighthouse health response"
nflaig Jul 14, 2023
cfcc70e
Revert "Update Dockerfile"
wemeetagain Jul 14, 2023
cf9f1da
Revert CI from using node 20
wemeetagain Jul 14, 2023
3f6dd77
Revert "skip tests that break in CI"
wemeetagain Jul 14, 2023
f716f64
Fix the loader for few sim tests
nazarhussain Jul 15, 2023
2e115d0
Update CI node version to 20
nazarhussain Jul 15, 2023
49df2c2
Fix e2e test
nazarhussain Jul 15, 2023
2925e87
Remove try/catch from e2e test
nflaig Jul 16, 2023
0190311
Consistently use node 20 in CI
nflaig Jul 16, 2023
7744f8f
Fix missed 18.x reference in types readme
nflaig Jul 16, 2023
3ae47c4
Set node 20.x in readme
nflaig Jul 16, 2023
1887287
Use node 18 in sim tests
nflaig Jul 16, 2023
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
25 changes: 11 additions & 14 deletions packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,13 @@ describe("eth1 / jsonRpcHttpClient", function () {
const controller = new AbortController();
if (abort) setTimeout(() => controller.abort(), 50);
const eth1JsonRpcClient = new JsonRpcHttpClient([url], {signal: controller.signal});

try {
await eth1JsonRpcClient.fetch(payload, {timeout});
} catch (error) {
await expect(eth1JsonRpcClient.fetch(payload, {timeout})).to.be.rejected.then((error) => {
if (testCase.errorCode) {
expect((error as FetchError).code).to.eql(testCase.errorCode);
expect((error as FetchError).code).to.be.equal(testCase.errorCode);
} else {
expect((error as Error).message).includes(testCase.error);
expect((error as Error).message).to.include(testCase.error);
}
}
});
Copy link
Contributor

@nazarhussain nazarhussain Jul 16, 2023

Choose a reason for hiding this comment

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

I think we discussed to no use the nested then/catch and prefer try/catch.

Copy link
Member

Choose a reason for hiding this comment

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

I was not part of that discussion but in my opinion try/catch in tests should be last resort if there are no other options to use built-in assertion syntax

});
}
});
Expand Down Expand Up @@ -215,19 +212,19 @@ describe("eth1 / jsonRpcHttpClient - with retries", function () {

const controller = new AbortController();
const eth1JsonRpcClient = new JsonRpcHttpClient([url], {signal: controller.signal});
try {
await eth1JsonRpcClient.fetchWithRetries(payload, {
await expect(
eth1JsonRpcClient.fetchWithRetries(payload, {
retryAttempts,
shouldRetry: () => {
// using the shouldRetry function to keep tab of the retried requests
retryCount++;
return true;
},
});
} catch (error) {
expect((error as FetchError).code).eql("ECONNREFUSED");
}
expect(retryCount).to.be.equal(retryAttempts, "connect ECONNREFUSED should be retried before failing");
})
).to.be.rejected.then((error) => {
expect((error as FetchError).code).to.be.equal("ECONNREFUSED");
});
expect(retryCount).to.be.equal(retryAttempts, "code ECONNREFUSED should be retried before failing");
});

it("should retry 404", async function () {
Expand Down