From 0ae1701025606943916e1702c2967c8bc8aa2328 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Mon, 19 Aug 2024 11:48:44 +0200 Subject: [PATCH] Adjust SQL Server GitHub Action + fix flaky SQL Server Test --- .github/workflows/sql-server.yml | 7 ++++++- .../rest/service/api/runtime/CaseInstanceResourceTest.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sql-server.yml b/.github/workflows/sql-server.yml index 976a32c63e9..4c52e79a71c 100644 --- a/.github/workflows/sql-server.yml +++ b/.github/workflows/sql-server.yml @@ -20,6 +20,11 @@ jobs: fail-fast: false matrix: mssql: [2017-latest-ubuntu, 2019-latest] + include: + - mssql: 2017-latest-ubuntu + healthRunnable: /opt/mssql-tools/bin/sqlcmd + - mssql: 2019-latest + healthRunnable: /opt/mssql-tools18/bin/sqlcmd -C services: mssql: image: mcr.microsoft.com/mssql/server:${{ matrix.mssql }} @@ -30,7 +35,7 @@ jobs: - 1433/tcp # needed because the mssql container does not provide a health check options: >- - --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P flowableStr0ngPassword -l 30 -Q \"SELECT 1\" || exit 1" + --health-cmd="${{ matrix.healthRunnable }} -S localhost -U sa -P flowableStr0ngPassword -l 30 -Q \"SELECT 1\" || exit 1" --health-start-period 10s --health-interval 10s --health-timeout 5s diff --git a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceResourceTest.java b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceResourceTest.java index d5176c831d5..7203eac6feb 100644 --- a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceResourceTest.java +++ b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceResourceTest.java @@ -18,9 +18,9 @@ import java.io.IOException; import java.io.Serializable; -import java.sql.Date; import java.time.Instant; import java.time.temporal.ChronoUnit; +import java.util.Date; import org.apache.http.HttpStatus; import org.apache.http.client.methods.CloseableHttpResponse; @@ -57,6 +57,8 @@ public class CaseInstanceResourceTest extends BaseSpringRestTestCase { @CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" }) public void testGetCaseInstance() throws Exception { Authentication.setAuthenticatedUserId("getCaseUser"); + cmmnEngineConfiguration.getClock() + .setCurrentTime(Date.from(Instant.now().truncatedTo(ChronoUnit.SECONDS))); CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder() .caseDefinitionKey("oneHumanTaskCase") .businessKey("myBusinessKey")