From b9eeda0df25f9ad4da16491470df4be404bfc421 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Thu, 15 Aug 2024 13:00:43 -0700 Subject: [PATCH] Improve test time and flaky schedule test (#2183) Try running CI on 16 core runners --- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .../temporal/client/schedules/ScheduleTest.java | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b531cc743..c2c7fbf62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: unit_test_edge: name: Unit test with in-memory test service [Edge] - runs-on: ubuntu-latest + runs-on: ubuntu-latest-16-cores timeout-minutes: 30 steps: - name: Checkout repo @@ -47,7 +47,7 @@ jobs: unit_test_jdk8: name: Unit test with docker service [JDK8] - runs-on: ubuntu-latest + runs-on: ubuntu-latest-16-cores timeout-minutes: 30 steps: - name: Checkout repo diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 499f1f235..aecfa5b62 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -6,7 +6,7 @@ on: jobs: code-coverage: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-16-cores steps: - name: Checkout uses: actions/checkout@v4 diff --git a/temporal-sdk/src/test/java/io/temporal/client/schedules/ScheduleTest.java b/temporal-sdk/src/test/java/io/temporal/client/schedules/ScheduleTest.java index 1c37c579a..6eb2067e3 100644 --- a/temporal-sdk/src/test/java/io/temporal/client/schedules/ScheduleTest.java +++ b/temporal-sdk/src/test/java/io/temporal/client/schedules/ScheduleTest.java @@ -260,14 +260,15 @@ public void triggerScheduleNoPolicy() { @Test(timeout = 30000) public void backfillSchedules() { - // assumeTrue("skipping for test server", SDKTestWorkflowRule.useExternalService); - Instant now = Instant.now(); + Instant backfillTime = Instant.ofEpochSecond(100000); ScheduleClient client = createScheduleClient(); // Create schedule ScheduleOptions options = ScheduleOptions.newBuilder() .setBackfills( - Arrays.asList(new ScheduleBackfill(now.minusMillis(20500), now.minusMillis(10000)))) + Arrays.asList( + new ScheduleBackfill( + backfillTime.minusMillis(20500), backfillTime.minusMillis(10000)))) .build(); String scheduleId = UUID.randomUUID().toString(); Schedule schedule = @@ -283,8 +284,8 @@ public void backfillSchedules() { handle.backfill( Arrays.asList( - new ScheduleBackfill(now.minusMillis(5500), now.minusMillis(2500)), - new ScheduleBackfill(now.minusMillis(2500), now))); + new ScheduleBackfill(backfillTime.minusMillis(5500), backfillTime.minusMillis(2500)), + new ScheduleBackfill(backfillTime.minusMillis(2500), backfillTime))); waitForActions(handle, 15); // Cleanup schedule handle.delete(); @@ -292,8 +293,8 @@ public void backfillSchedules() { try { handle.backfill( Arrays.asList( - new ScheduleBackfill(now.minusMillis(5500), now.minusMillis(2500)), - new ScheduleBackfill(now.minusMillis(2500), now))); + new ScheduleBackfill(backfillTime.minusMillis(5500), backfillTime.minusMillis(2500)), + new ScheduleBackfill(backfillTime.minusMillis(2500), backfillTime))); Assert.fail(); } catch (ScheduleException e) { }