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

[e2e] Prevent the dockerUp function from failing by retrying when node version check returns undefined #3741

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "e2e",
"displayName": "E2E Tests",
"version": "0.7.0",
"version": "0.7.1",
"private": true,
"description": "Teraslice integration test suite",
"keywords": [
Expand Down
10 changes: 9 additions & 1 deletion e2e/test/docker-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ms from 'ms';
import semver from 'semver';
import { DEFAULT_WORKERS, NODE_VERSION } from './config.js';
import signale from './signale.js';
import { pRetry } from '@terascope/utils';

const compose = new Compose('docker-compose.yml');

Expand Down Expand Up @@ -36,7 +37,14 @@ export async function dockerUp() {
});
signale.success('Docker environment is good to go', getElapsed(startTime));

const e2eNodeVersion = await compose.runCmd('exec', undefined, 'teraslice-master', 'node', '--version');
const e2eNodeVersion = await pRetry(async () => {
const version = await compose.runCmd('exec', undefined, 'teraslice-master', 'node', '--version');
if (version === undefined) {
throw new Error('Node version check failed to return a result.');
}
return version;
})

const scriptsNodeVersion = semver.coerce(NODE_VERSION);
const parsedVersion = semver.parse(e2eNodeVersion);
signale.info('Teraslice node version: ', parsedVersion?.version);
Expand Down
Loading