Skip to content

Commit

Permalink
Merge pull request #1060 from twilio/optimise-e2e
Browse files Browse the repository at this point in the history
Add task kill for windows E2E
  • Loading branch information
shwet2407 authored Oct 7, 2024
2 parents f450602 + 7e4ef74 commit b25d1fc
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/~reusable_e2e_by_OS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
env:
TS: 0
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
timeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
Expand All @@ -153,7 +153,7 @@ jobs:
env:
TS: 0
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
gtimeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
Expand All @@ -163,7 +163,7 @@ jobs:
env:
TS: 0
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
$attempts = 2
$timeout = 5400000 # 90 minutes in milliseconds
cd packages/flex-plugin-e2e-tests
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
env:
TS: 1
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
timeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
Expand All @@ -205,7 +205,7 @@ jobs:
env:
TS: 1
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
gtimeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
Expand All @@ -215,19 +215,26 @@ jobs:
env:
TS: 1
run: |
echo "Starting e2e tests with a 10-minute timeout"
echo "Starting e2e tests with a 90-minute timeout"
$attempts = 2
$timeout = 5400000 # 90 minutes in milliseconds
cd packages/flex-plugin-e2e-tests
for ($i=1; $i -le $attempts; $i++) {
try {
$process = Start-Process -FilePath 'npm' -ArgumentList 'run start' -NoNewWindow -PassThru
if ($process.WaitForExit($timeout)) {
echo 'E2E tests completed successfully'
exit 0
if ($process.ExitCode -eq 0) {
echo 'E2E tests completed successfully'
exit 0
} else {
echo "E2E tests failed with exit code $($process.ExitCode). Retrying..."
Stop-Process -Id $process.Id
taskkill /f /im node.exe
}
} else {
echo 'E2E tests timed out. Retrying...'
Stop-Process -Id $process.Id
taskkill /f /im node.exe
}
} catch {
echo 'E2E tests failed.'
Expand Down

0 comments on commit b25d1fc

Please sign in to comment.