Skip to content

Commit bc628a7

Browse files
authored
fix(e2e): improve smoke test stability (#14672)
1 parent 1eba0c3 commit bc628a7

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/actions/run-smoke-tests/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ runs:
6767
6868
- name: Run Smoke Tests
6969
shell: bash
70-
run: yarn smoketest -- --forceExit --no-cache --maxWorkers=2
70+
run: |
71+
set +e
72+
yarn smoketest -- --forceExit --no-cache --maxWorkers=2
73+
EXIT_CODE=$?
74+
if [ $EXIT_CODE -ne 0 ]; then
75+
echo "::warning::Smoke tests failed on first attempt (exit code $EXIT_CODE). Retrying in 30s..."
76+
sleep 30
77+
yarn smoketest -- --forceExit --no-cache --maxWorkers=2
78+
EXIT_CODE=$?
79+
fi
80+
exit $EXIT_CODE
7181
env:
7282
CLI_REGION: ${{ inputs.region }}
7383
CI: true

packages/amplify-e2e-tests/src/__tests__/smoke-tests/smoketest-amplify-app.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
} from '../../amplify-app-helpers/amplify-app-validation';
1313
import execa from 'execa';
1414

15+
jest.retryTimes(1);
16+
1517
describe('amplify-app platform tests', () => {
1618
let projRoot: string;
1719

packages/amplify-e2e-tests/src/__tests__/smoke-tests/smoketest-ios.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
import * as fs from 'fs/promises';
1111
import * as path from 'path';
1212

13+
jest.retryTimes(1);
14+
1315
describe('Smoke Test - iOS', () => {
1416
if (process.platform == 'darwin') {
1517
let projRoot: string;

packages/amplify-e2e-tests/src/__tests__/smoke-tests/smoketest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33
import * as fs from 'fs-extra';
44
import * as os from 'os';
55
import { getCLIPath, initJSProjectWithProfile, nspawn as spawn } from '@aws-amplify/amplify-e2e-core';
6-
jest.retryTimes(0);
6+
jest.retryTimes(1);
77

88
export type SmoketestArgs = {
99
projectDirectory: string;

0 commit comments

Comments
 (0)