Update chain checks with "Unable to init" (#6686)

This commit is contained in:
Jaco 2021-12-15 17:11:47 +01:00 committed by GitHub
parent f8a086ee1e
commit b188f788e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View File

@ -33,8 +33,8 @@
"build:release:www": "yarn polkadot-ci-ghact-build && yarn build:release:ghpages && yarn build:release:ipfs",
"build:robohash": "node scripts/robohash.cjs",
"build:www": "rm -rf packages/apps/build && mkdir -p packages/apps/build && yarn run build:i18n && cd packages/apps && yarn webpack --config webpack.config.cjs",
"ci:chainEndpoints": "polkadot-dev-run-test --silent packages/apps-config/src/ci/chainEndpoints",
"ci:chainTypes": "polkadot-dev-run-test --silent packages/apps-config/src/ci/chainTypes",
"ci:chainEndpoints": "polkadot-dev-run-test packages/apps-config/src/ci/chainEndpoints",
"ci:chainTypes": "polkadot-dev-run-test packages/apps-config/src/ci/chainTypes",
"clean": "polkadot-dev-clean-build",
"clean:electronBuild": "cd packages/apps-electron && polkadot-dev-clean-build",
"clean:electronRelease": "cd packages/apps-electron && rm -rf release",

View File

@ -6,6 +6,7 @@ import { checkEndpoints } from './util';
describe('--SLOW--: check configured chain endpoints', (): void => {
checkEndpoints('./.github/chain-endpoints.md', [
'No DNS entry for',
'Timeout connecting to'
'Timeout connecting to',
'Unable to initialize'
]);
});

View File

@ -5,6 +5,6 @@ import { checkEndpoints } from './util';
describe('--SLOW--: check configured chain types', (): void => {
checkEndpoints('./.github/chain-types.md', [
'Cannot construct unknown type'
'Unknown types'
]);
});

View File

@ -36,9 +36,12 @@ export function checkEndpoints (issueFile: string, failures: string[]): void {
name: text as string,
ws: value
}))
.filter((v) => v.ws && v.ws.includes('geometry.io'))
.filter((v): v is Endpoint => !!v.ws)
.forEach(({ name, ws }) =>
it(`${name} @ ${ws}`, async (): Promise<void> => {
console.error(`>>> ${name} @ ${ws}`);
const [,, hostWithPort] = ws.split('/');
const [host] = hostWithPort.split(':');
@ -71,9 +74,9 @@ export function checkEndpoints (issueFile: string, failures: string[]): void {
timerId = setTimeout((): void => {
timerId = null;
reject(new Error(`Timeout connecting to ${ws}`));
}, 10_000);
}, 30_000);
}),
api.isReadyOrError
api.isReadyOrError.then((api) => api.rpc.chain.getBlock().then((b) => console.log(b.toHuman())))
]);
} catch (error) {
if (isError(error) && failures.some((f) => (error as Error).message.includes(f))) {
@ -81,6 +84,8 @@ export function checkEndpoints (issueFile: string, failures: string[]): void {
throw error;
}
console.error(JSON.stringify(error));
} finally {
if (timerId) {
clearTimeout(timerId);