Skip to content

Commit 44539a3

Browse files
diemolclaude
andauthored
Migrate Sauce Connect GitHub Action from v2 (SC4) to v3 (SC5) (#624)
* Migrate Sauce Connect GitHub Action from v2 (SC4) to v3 (SC5) Sauce Connect 4 reached end-of-life and Sauce Labs servers now reject SC4 tunnel connections with "remote shutdown", causing Integration Tests to fail after 3 retries (see run 34756631021). Bump saucelabs/sauce-connect-action to v3, which defaults to Sauce Connect 5, and add the now-required region input to each step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Use full SC5 region identifiers (us-west-1, eu-central-1) The v3 action's SC5 CLI rejects the short-form region names used by v2/SC4 ("us-west", "eu-central"): "Option region contains invalid value, allowed are: us-west-1, us-east-4, eu-central-1, staging". Confirmed by the failed run on this PR. Update both the action's region input and the Sauce Connect YAML config files to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Use distinct apiAddress per Sauce Connect tunnel to fix readiness race The action's readiness check polls apiAddress/readyz, which defaults to ':8032' for every invocation. Running both tunnels on the same runner meant the EU-Central step's readiness check could observe the already-running US-West process on the shared port and report ready immediately, before its own tunnel had actually come up (see PR #624 CI run: EU-Central step ended right after "provisioning Sauce Connect", never logging "Sauce Connect is up"). Give each tunnel its own apiAddress (:8032 / :8033) so each readiness check is scoped to its own process. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Remove nick-invision/retry wrapper around Integration Tests The outer retry reran the entire "mvn clean test" (including a fresh JVM/clean) up to 3 times on failure, but doesn't restart the Sauce Connect tunnels. Once SauceConnectEndpointTest's @afterall tears down all of the account's tunnels at the end of attempt 1, attempts 2 and 3 have no tunnels at all and every Sauce Connect-dependent test fails, turning one flaky test into a wall of unrelated failures. Surefire is already configured with -Dsurefire.rerunFailingTestsCount=2, which reruns individual failing tests within the same Maven/JVM invocation (tunnels stay up throughout), giving the same flaky-test protection without the cascade. Keep the 20-minute timeout as a native step timeout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Increase stopJobTest's status-poll timeout to 60s stopJobTest was consistently failing with ConditionTimeoutException waiting for job status to reach "complete" within 20s, across every CI run in PR #624 (both data centers, every Surefire rerun). Unlike runTest/runEmulatorTest/runSimulatorTest (which quit the driver client-side and reliably reach "complete" within 20s), this test stops the job via the REST API's /stop endpoint, which appears to take noticeably longer to finalize the job (asset processing, teardown) than a client-initiated driver.quit(). Give it a 60s budget instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Bump stopJobTest timeout to 90s based on measured live behavior 60s (the previous attempt) still wasn't enough. Reproduced locally against the live Sauce Labs API and queried the created jobs directly: both the US-West and EU-Central jobs report error="User Abandoned Test -- User terminated" and consistently take ~67-70s (creation_time to end_time) to finalize as "complete" after a REST-initiated stop. Sauce Labs treats an API stop as an abandoned session and runs it through an idle-detection grace period before finalizing, which a client can't speed up. 90s gives comfortable margin above the observed ~70s. Verified locally: both parameterized cases now pass in ~69s each. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P * Drop inline comment explaining stopJobTest's 90s timeout Rationale (Sauce Labs treats a REST stop as an abandoned session with a ~67-70s idle-detection grace period before finalizing to "complete") is already captured in the commit history rather than as a code comment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpTwokDRhY4c4hKZXqX35P --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a15e5a1 commit 44539a3

6 files changed

Lines changed: 24 additions & 16 deletions

File tree

‎.github/workflows/java-ci.yml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,29 @@ jobs:
7676
cache: 'maven'
7777

7878
- name: Setup Sauce Connect US-West
79-
uses: saucelabs/sauce-connect-action@v2
79+
uses: saucelabs/sauce-connect-action@v3
8080
with:
8181
username: ${{ secrets.SAUCE_USERNAME }}
8282
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
83+
region: us-west-1
8384
tunnelName: github-action-tunnel-us-west
8485
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-us-west.yaml
86+
apiAddress: ':8032'
8587

8688
- name: Setup Sauce Connect EU-Central
87-
uses: saucelabs/sauce-connect-action@v2
89+
uses: saucelabs/sauce-connect-action@v3
8890
with:
8991
username: ${{ secrets.SAUCE_USERNAME }}
9092
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
93+
region: eu-central-1
9194
tunnelName: github-action-tunnel-eu-central
9295
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-eu-central.yaml
96+
apiAddress: ':8033'
9397

9498
- name: Build and Run Integration Tests
9599
if: ${{ env.NOT_FROM_FORK }} == 'true'
96-
uses: nick-invision/retry@v4.0.0
97-
with:
98-
timeout_minutes: 20
99-
max_attempts: 3
100-
command: |
101-
mvn clean test -Dtest="com.saucelabs.saucerest.integration.**" -Dgpg.skip -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dsurefire.rerunFailingTestsCount=2 -V
100+
timeout-minutes: 20
101+
run: mvn clean test -Dtest="com.saucelabs.saucerest.integration.**" -Dgpg.skip -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dsurefire.rerunFailingTestsCount=2 -V
102102

103103
- name: Upload JaCoCo report to Codecov
104104
uses: codecov/codecov-action@v5

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,24 @@ jobs:
3535
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
3636

3737
- name: Setup Sauce Connect US-West
38-
uses: saucelabs/sauce-connect-action@v2
38+
uses: saucelabs/sauce-connect-action@v3
3939
with:
4040
username: ${{ secrets.SAUCE_USERNAME }}
4141
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
42+
region: us-west-1
4243
tunnelName: github-action-tunnel-us-west
4344
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-us-west.yaml
45+
apiAddress: ':8032'
4446

4547
- name: Setup Sauce Connect EU-Central
46-
uses: saucelabs/sauce-connect-action@v2
48+
uses: saucelabs/sauce-connect-action@v3
4749
with:
4850
username: ${{ secrets.SAUCE_USERNAME }}
4951
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
52+
region: eu-central-1
5053
tunnelName: github-action-tunnel-eu-central
5154
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-eu-central.yaml
55+
apiAddress: ':8033'
5256

5357
- name: Build with Maven
5458
run: mvn clean install -Dgpg.skip -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -V

‎.github/workflows/setup-sauce-connect-tunnels.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Setup Sauce Connect US-West
19-
uses: saucelabs/sauce-connect-action@v2
19+
uses: saucelabs/sauce-connect-action@v3
2020
with:
2121
username: ${{ secrets.SAUCE_USERNAME }}
2222
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
23+
region: us-west-1
2324
tunnelName: github-action-tunnel-us-west
2425
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-us-west.yaml
26+
apiAddress: ':8032'
2527

2628
- name: Setup Sauce Connect EU-Central
27-
uses: saucelabs/sauce-connect-action@v2
29+
uses: saucelabs/sauce-connect-action@v3
2830
with:
2931
username: ${{ secrets.SAUCE_USERNAME }}
3032
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
33+
region: eu-central-1
3134
tunnelName: github-action-tunnel-eu-central
32-
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-eu-central.yaml
35+
configFile: ${{ github.workspace }}/src/test/resources/sauce-connect-config-eu-central.yaml
36+
apiAddress: ':8033'

‎src/test/java/com/saucelabs/saucerest/integration/JobsEndpointTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public void stopJobTest(DataCenter dataCenter, TestInfo testInfo) throws IOExcep
399399
Assertions.assertDoesNotThrow(
400400
() ->
401401
Awaitility.await()
402-
.atMost(Duration.ofSeconds(20))
402+
.atMost(Duration.ofSeconds(90))
403403
.pollInterval(Duration.ofSeconds(1))
404404
.pollInSameThread()
405405
.until(() -> "complete".equals(jobs.get().getJobDetails(finalSessionID).status)));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
region: 'eu-central'
2+
region: 'eu-central-1'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
region: 'us-west'
2+
region: 'us-west-1'

0 commit comments

Comments
 (0)