From 0ca968b6cfdd7dff3f1d013479481d6ab326d8fc Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 09:35:44 -0600 Subject: [PATCH 01/14] CCOR-13193 - run integration tests against Conductor OSS, and fix two client bugs it surfaced --- .github/workflows/integration-tests.yml | 154 +++++++++++++++++- CONTRIBUTING.md | 41 +++++ .../workflow/executor/WorkflowExecutor.java | 17 +- .../task/AnnotatedWorkerExecutor.java | 53 +++++- .../WorkflowExecutorMonitorTests.java | 110 +++++++++++++ .../executor/task/AnnotatedWorkerTests.java | 78 +++++++++ scripts/docker-compose-oss.yaml | 43 +++++ scripts/run-integration-oss.sh | 131 +++++++++++++++ .../client/ServiceRegistryClientTest.java | 3 + .../conductor/client/WorkflowRetryTest.java | 3 + .../client/http/AuthorizationClientTests.java | 3 + .../client/http/EnvironmentClientTests.java | 3 + .../client/http/EventClientTests.java | 7 +- .../client/http/MetadataClientTests.java | 17 +- .../client/http/PromptClientTests.java | 3 + .../client/http/SchedulerClientTests.java | 5 + .../client/http/SchemaClientTests.java | 3 + .../client/http/SecretClientTests.java | 3 + .../http/ServiceRegistryClientTests.java | 3 + .../client/http/TaskClientTests.java | 36 +++- .../client/http/TokenClientTest.java | 3 + .../client/http/WorkflowClientTests.java | 5 + .../client/http/WorkflowStateUpdateTests.java | 5 + .../orkes/conductor/client/util/TestUtil.java | 23 +++ .../orkes/conductor/sdk/WorkflowSDKTests.java | 17 +- 25 files changed, 742 insertions(+), 27 deletions(-) create mode 100644 conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java create mode 100644 scripts/docker-compose-oss.yaml create mode 100755 scripts/run-integration-oss.sh diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 9ffbd9081..2d82efae7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,6 +5,26 @@ on: workflows: ["Java Client Build"] types: - completed + workflow_dispatch: + inputs: + oss_conductor_version: + description: 'OSS Conductor image tag (falls back to the E2E_TEST_OSS_CONDUCTOR_VERSION org var, then to the default in scripts/docker-compose-oss.yaml on fork PRs)' + required: false + type: string + + # --------------------------------------------------------------------------- + # TEMPORARY -- REMOVE BEFORE MERGE. + # + # A workflow_run-triggered run always executes the copy of this file on the + # default branch, so the integration-tests-oss job below cannot be exercised + # from a pull request. push runs the branch's own copy, so this trigger is + # what lets the job actually run while it is being developed. + # + # Deleting this block is sufficient to revert; nothing else below depends on it. + # --------------------------------------------------------------------------- + push: + branches: + - e2e-against-conductor-with-local-script # allow this workflow to update the status of the PR that triggered it permissions: @@ -12,7 +32,9 @@ permissions: checks: write concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }} + # head_branch is only set for workflow_run; fall back to the ref so runs from + # other triggers do not all collapse into one unnamed concurrency group. + group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }} cancel-in-progress: true jobs: @@ -44,7 +66,11 @@ jobs: if: always() with: report_paths: '**/build/test-results/test/TEST-*.xml' - + # Distinct per suite: the action defaults to 'JUnit Test Report' for every caller, so + # this report, the OSS one below, and ci.yml's unit report all landed on a single + # check run and overwrote each other. + check_name: Integration Test Report + - name: Update PR Status if: always() uses: actions/github-script@v8 @@ -60,4 +86,128 @@ jobs: description: 'Integration tests ${{ job.status }}' }); + # Runs against a throwaway Conductor OSS stack rather than the Orkes deployment the job above + # targets, so it needs no secrets and no `environment`. It is deliberately a sibling of that + # job, not a dependent: an OSS failure must not suppress the enterprise suite, or vice versa. + integration-tests-oss: + runs-on: ubuntu-latest + name: Integration Tests (OSS) + timeout-minutes: 30 + # The build-succeeded gate only makes sense for workflow_run, which is the only trigger that + # has a triggering run to inspect. Any other trigger is a direct request to run this suite. + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + env: + CONDUCTOR_SERVER_URL: http://localhost:8080/api + CONDUCTOR_SERVER_TYPE: oss + + steps: + # OSS_CONDUCTOR_VERSION is resolved here rather than in the job `env` so + # that the two ways it can come back empty get different treatment: + # + # - Fork PR: GitHub withholds org/repo variables from pull_request runs + # on forks exactly as it withholds secrets, so vars.* is always "" for + # an outside contributor (observed in csharp-sdk#178). This job needs + # no secrets, only a tag, so leave the var unset and let the default + # baked into the `image:` line of scripts/docker-compose-oss.yaml + # apply. That is the same tag a plain local run of + # scripts/run-integration-oss.sh gets, and the one place it is + # written -- no second copy to drift out of sync here. Note that the + # workflow_run trigger above executes in the base repo's context and + # does get the org variable even for a fork PR; the fork branch here + # matters for the push/dispatch paths and for any future direct + # pull_request trigger. + # - Anything else: the org variable is genuinely missing or its + # repository access policy no longer covers this repo. Fail loudly + # rather than silently drifting onto the default. + - name: Resolve OSS Conductor version + env: + REQUESTED_VERSION: ${{ inputs.oss_conductor_version || vars.E2E_TEST_OSS_CONDUCTOR_VERSION }} + IS_FORK_PR: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_run' && github.event.workflow_run.head_repository.full_name != github.repository) }} + run: | + if [ -n "$REQUESTED_VERSION" ]; then + echo "OSS_CONDUCTOR_VERSION=${REQUESTED_VERSION}" >> "$GITHUB_ENV" + elif [ "$IS_FORK_PR" = "true" ]; then + echo "::notice::Fork PR: org variables are withheld, falling back to the default tag in scripts/docker-compose-oss.yaml" + else + echo "::error::No Conductor OSS image tag resolved. Set the E2E_TEST_OSS_CONDUCTOR_VERSION organization variable (and ensure its repository access policy includes this repo), or pass the oss_conductor_version input via workflow_dispatch." + exit 1 + fi + + - name: Checkout + uses: actions/checkout@v6 + with: + # workflow_run carries the triggering run's head; workflow_dispatch has neither, and + # falls back to the ref the dispatch was made against. + ref: ${{ github.event.workflow_run.head_sha || github.sha }} + repository: ${{ github.event.workflow_run.repository.full_name || github.repository }} + + - name: Set up Zulu JDK 21 + uses: actions/setup-java@v5 + with: + distribution: "zulu" + java-version: "21" + + # `docker compose up` only pulls an image when it is missing locally. On a + # GitHub-hosted runner the VM is ephemeral and starts with no cached copy + # of this image, so `up` would pull anyway and this step is redundant + # today. It is here deliberately: it costs no extra network pull (`up` + # then finds the image locally), it separates "couldn't pull the image" + # from "the stack didn't come up" into two distinct red steps, and it is + # what keeps a mutable tag from going stale if this job ever moves to a + # self-hosted runner with a warm Docker daemon -- the same reason + # scripts/run-integration-oss.sh pulls. It also prints the tag actually in + # use, which for a fork PR comes from the compose file's default. + - name: Pull Conductor OSS image + run: | + echo "Using $(docker compose -f scripts/docker-compose-oss.yaml config --images | grep -m1 '^conductoross/conductor:')" + docker compose -f scripts/docker-compose-oss.yaml pull conductor-server + + - name: Start Conductor OSS stack + run: docker compose -f scripts/docker-compose-oss.yaml up -d + + - name: Wait for Conductor to be healthy + # Matches HEALTH_TIMEOUT in scripts/run-integration-oss.sh, and stays under the compose + # healthcheck's own ~200s budget. + run: timeout 180 bash -c 'until curl -sf http://localhost:8080/health; do sleep 5; done' + + - name: Run integration tests (OSS) + id: integration_tests + continue-on-error: true + run: ./gradlew :tests:test -PIntegrationTests + + - name: Dump Conductor logs + if: failure() || steps.integration_tests.outcome == 'failure' + run: docker compose -f scripts/docker-compose-oss.yaml logs conductor-server + + - name: Publish Test Report + if: always() + uses: mikepenz/action-junit-report@v6 + with: + report_paths: 'tests/build/test-results/test/TEST-*.xml' + check_name: OSS Integration Test Report + + # Before Update PR Status, not after: the test step is continue-on-error, so job.status is + # still 'success' until this step's exit 1 flips it. + - name: Check Integration Tests Status + if: steps.integration_tests.outcome == 'failure' + run: | + echo "::error::Integration tests (OSS) failed. See the 'Run integration tests (OSS)' step above for the Gradle/test output, the 'Dump Conductor logs' step for server-side logs, and the 'Publish Test Report' step's JUnit summary for which test(s) failed." + exit 1 + + - name: Update PR Status + # Skipped on workflow_dispatch: there is no triggering run, so there is no PR head to + # report against and context.payload.workflow_run would be undefined. + if: ${{ always() && github.event_name == 'workflow_run' }} + uses: actions/github-script@v8 + with: + script: | + const { owner, repo } = context.repo; + const sha = context.payload.workflow_run.head_sha; + await github.rest.repos.createCommitStatus({ + owner, repo, sha, + state: '${{ job.status }}' === 'success' ? 'success' : 'failure', + context: 'Integration Tests (OSS)', + target_url: `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`, + description: 'OSS integration tests ${{ job.status }}' + }); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7bfa1458c..7876321c5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,47 @@ Run the SDK test suite: ./gradlew test jacocoTestReport ``` +### Running the OSS integration suite locally + +The `tests` module also has an integration suite (`-PIntegrationTests`) that runs against a +real Conductor server, separate from the unit suite above. `scripts/run-integration-oss.sh` +mirrors the `integration-tests-oss` job in `integration-tests.yml`: it starts a local Conductor OSS + +Postgres stack (defined in `scripts/docker-compose-oss.yaml`), waits for `/health`, runs the +integration suite, and tears the stack down on exit. + +```shell +scripts/run-integration-oss.sh # against `latest` +scripts/run-integration-oss.sh --version 3.32.0-rc18 +scripts/run-integration-oss.sh --keep-up # leave the stack running afterwards +scripts/run-integration-oss.sh --include-gated # also run tests normally skipped as Orkes-only +``` + +The script always prints the resolved `conductoross/conductor` tag and pulls it before +starting the stack, since `latest` (the local default) is a mutable tag — without an +explicit pull, `docker compose up` would silently reuse a stale cached image instead of +fetching the current one. It also always runs Gradle with `--rerun-tasks`, since the `test` +task's up-to-date check doesn't account for env vars like `CONDUCTOR_SERVER_TYPE` or the +state of the live server underneath — without it, a rerun after changing gating or switching +server versions could silently report a stale cached result instead of executing anything. + +The script doesn't pin a JDK itself, but CI runs on Zulu 21. If your local default JDK is +newer (e.g. 23) you may hit `Unsupported class file major version` errors compiling tests — +set `JAVA_HOME` explicitly to match CI: + +```shell +JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home ./scripts/run-integration-oss.sh +``` + +Tests annotated `@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = +"oss")` skip themselves against plain OSS because they exercise Orkes-managed-only features +(e.g. the Service Registry, Authorization, Prompts/Integrations, Environment Variables, and +Secrets APIs, plus a handful of task/workflow endpoints OSS doesn't implement or that hit +known Postgres-persistence bugs). Each annotation's `disabledReason` documents the specific, +empirically-confirmed gap — treat those as the source of truth rather than a list here, since +they can drift as OSS gains features. If you add or remove that annotation, re-verify against +a freshly-pulled image first: a test that fails against a stale local image may pass against +current OSS, and vice versa. + Compile the maintained agent examples when changing their APIs or documentation: ```shell diff --git a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java index 33654d78d..f185e6e6d 100644 --- a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java +++ b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java @@ -174,10 +174,21 @@ private void initMonitor() { for (Map.Entry> entry : runningWorkflowFutures.entrySet()) { String workflowId = entry.getKey(); CompletableFuture future = entry.getValue(); - Workflow workflow = workflowClient.getWorkflow(workflowId, true); - if (workflow.getStatus().isTerminal()) { - future.complete(workflow); + try { + Workflow workflow = workflowClient.getWorkflow(workflowId, true); + if (workflow.getStatus().isTerminal()) { + future.complete(workflow); + runningWorkflowFutures.remove(workflowId); + } + } catch (Exception e) { + // scheduleAtFixedRate silently kills all future ticks on any uncaught + // exception, so this must not escape: one failed poll would otherwise + // stop completion tracking for every workflow, forever. Stop tracking + // this one and let its caller see the failure. + LOGGER.error("Error polling workflow {} for completion; completing its " + + "future exceptionally", workflowId, e); runningWorkflowFutures.remove(workflowId); + future.completeExceptionally(e); } } }, diff --git a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerExecutor.java b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerExecutor.java index e2ed6d107..634f9399f 100644 --- a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerExecutor.java +++ b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerExecutor.java @@ -52,6 +52,12 @@ public class AnnotatedWorkerExecutor { private final Set scannedPackages = new HashSet<>(); + /** + * Set whenever a worker is added, cleared whenever {@link #startPolling()} builds a task runner. + * Lets startPolling() distinguish a real (re)start from a redundant duplicate call. + */ + private boolean workersChanged = false; + private final WorkerConfiguration workerConfiguration; public AnnotatedWorkerExecutor(TaskClient taskClient) { @@ -77,6 +83,9 @@ public AnnotatedWorkerExecutor(TaskClient taskClient, WorkerConfiguration worker */ public synchronized void initWorkers(String... basePackages) { scanWorkers(basePackages); + // scanWorkers() -> initWorkersFromClasses() -> initWorkersFromInstances() already reaches + // startPolling(). This second call is therefore redundant, but startPolling() is idempotent + // while the worker set is unchanged, so it is a no-op rather than a task runner restart. startPolling(); } @@ -109,10 +118,18 @@ public synchronized void initWorkersFromClasses(List> classes } - /** Shuts down the workers */ - public void shutdown() { + /** + * Shuts down the workers. + * + *

Clears the task runner as well as shutting it down, so a later {@link #startPolling()} + * builds a fresh one and resumes. A {@link TaskRunnerConfigurer} is single-use — its + * shutdown closes the executor backing it — so leaving the field set would make + * startPolling() take its already-polling fast path and never poll again. + */ + public synchronized void shutdown() { if (taskRunner != null) { taskRunner.shutdown(); + taskRunner = null; } } @@ -168,7 +185,15 @@ private boolean classBelongsToPackage(List packagesToScan, String classN return false; } - public void addBean(Object bean) { + /** + * Registers every {@link WorkerTask}-annotated method on the bean as a worker. + * + *

Synchronized because it is the public entry point that mutates the worker set and the + * {@code workersChanged} flag {@link #startPolling()} reads to decide whether a restart is + * needed. Without a common lock, a worker added on another thread could be missed and never + * polled. + */ + public synchronized void addBean(Object bean) { Class clazz = bean.getClass(); for (Method method : clazz.getMethods()) { WorkerTask annotation = method.getAnnotation(WorkerTask.class); @@ -222,6 +247,7 @@ private void addMethod(WorkerTask annotation, Method method, Object bean) { for (int i = 0; i < pollerCount; i++) { workers.add(executor); } + workersChanged = true; LOGGER.info( "Adding worker for task {}, method {} with threadCount {} and polling interval set to {} ms", @@ -231,11 +257,28 @@ private void addMethod(WorkerTask annotation, Method method, Object bean) { pollingInterval); } - public void startPolling() { + /** + * Builds a {@link TaskRunnerConfigurer} over the currently registered workers and starts polling. + * + *

Idempotent: if a task runner is already polling and no worker has been added since it was + * built, this returns without doing anything. Restarting unnecessarily would stand up a second + * runner polling the same task types and only shut the first one down afterwards, so a task + * already leased by the outgoing runner could be left in-progress until its response timeout + * expired. Callers that add workers and call this again still get the intended restart. + */ + public synchronized void startPolling() { if (workers.isEmpty()) { return; } + if (taskRunner != null && !workersChanged) { + LOGGER.debug( + "Task runner is already polling {} workers and the worker set is unchanged; " + + "skipping redundant restart.", + workers.size()); + return; + } + LOGGER.info("Starting {} with threadCount {}", workers.stream().map(Worker::getTaskDefName).toList(), workerToThreadCount); LOGGER.info("Worker domains {}", workerDomains); LOGGER.info("Worker workerToPollTimeout (in millis) {}", workerToPollTimeout); @@ -253,6 +296,8 @@ public void startPolling() { taskRunner = builder.build(); taskRunner.init(); + workersChanged = false; + oldTaskRunner.ifPresent(taskRunner -> { LOGGER.trace("Shutting down previous task runner with {} workers.", taskRunner.getWorkerCount()); taskRunner.shutdown(); diff --git a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java new file mode 100644 index 000000000..56f684ac4 --- /dev/null +++ b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Conductor Authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.netflix.conductor.sdk.workflow.executor; + +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import com.netflix.conductor.client.http.MetadataClient; +import com.netflix.conductor.client.http.TaskClient; +import com.netflix.conductor.client.http.WorkflowClient; +import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest; +import com.netflix.conductor.common.run.Workflow; +import com.netflix.conductor.sdk.workflow.executor.task.AnnotatedWorkerExecutor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * Covers the completion-tracking monitor started by {@link WorkflowExecutor}'s constructors. The + * monitor runs under {@code scheduleAtFixedRate}, which cancels all future ticks on any uncaught + * exception, so a single failed {@code getWorkflow} call must not be allowed to escape. + */ +public class WorkflowExecutorMonitorTests { + + private static final String WORKFLOW_ID = "test-workflow-id"; + + private static final String OTHER_WORKFLOW_ID = "other-test-workflow-id"; + + private WorkflowExecutor executorFor(WorkflowClient workflowClient) { + return new WorkflowExecutor( + mock(TaskClient.class), + workflowClient, + mock(MetadataClient.class), + mock(AnnotatedWorkerExecutor.class)); + } + + @Test + @DisplayName("a failed poll should complete that workflow's future exceptionally") + void monitorFailsTheFutureOnPollFailure() { + WorkflowClient workflowClient = mock(WorkflowClient.class); + when(workflowClient.startWorkflow(any(StartWorkflowRequest.class))).thenReturn(WORKFLOW_ID); + when(workflowClient.getWorkflow(anyString(), anyBoolean())) + .thenThrow(new RuntimeException("poll failure")); + + WorkflowExecutor executor = executorFor(workflowClient); + try { + CompletableFuture future = executor.executeWorkflow("wf", 1, Map.of()); + + ExecutionException thrown = assertThrows( + ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); + + assertInstanceOf(RuntimeException.class, thrown.getCause()); + assertEquals("poll failure", thrown.getCause().getMessage()); + } finally { + executor.shutdown(); + } + } + + @Test + @DisplayName("one workflow's poll failure should not stop the monitor tracking the rest") + void monitorKeepsTrackingOtherWorkflowsAfterAFailure() throws Exception { + Workflow completed = new Workflow(); + completed.setStatus(Workflow.WorkflowStatus.COMPLETED); + + WorkflowClient workflowClient = mock(WorkflowClient.class); + when(workflowClient.startWorkflow(any(StartWorkflowRequest.class))) + .thenReturn(WORKFLOW_ID) + .thenReturn(OTHER_WORKFLOW_ID); + when(workflowClient.getWorkflow(eq(WORKFLOW_ID), anyBoolean())) + .thenThrow(new RuntimeException("poll failure")); + when(workflowClient.getWorkflow(eq(OTHER_WORKFLOW_ID), anyBoolean())) + .thenReturn(completed); + + WorkflowExecutor executor = executorFor(workflowClient); + try { + CompletableFuture failing = executor.executeWorkflow("wf", 1, Map.of()); + assertThrows(ExecutionException.class, () -> failing.get(5, TimeUnit.SECONDS)); + + // Registered only after the failure has already happened, so it can complete at all + // only if the tick loop survived it -- scheduleAtFixedRate would have cancelled every + // future tick had the exception been allowed to escape. + CompletableFuture healthy = executor.executeWorkflow("wf", 1, Map.of()); + assertEquals(Workflow.WorkflowStatus.COMPLETED, healthy.get(5, TimeUnit.SECONDS).getStatus()); + } finally { + executor.shutdown(); + } + } +} diff --git a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java index abc4a19fd..37c0b4c7c 100644 --- a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java +++ b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java @@ -84,6 +84,84 @@ void directInstanceSupply() { ))); } + @Test + @DisplayName("initWorkers should leave exactly one task runner polling") + void initWorkersStartsASingleTaskRunner() { + var executor = new AnnotatedWorkerExecutor(mock(TaskClient.class)); + executor.initWorkers("com.netflix.conductor.sdk.workflow.executor.task.workers1"); + + var runner = executor.getTaskRunner(); + assertNotNull(runner); + + // The shape used by examples/old/.../taskdomains/Main.java and by callers following the + // docs: initWorkers() followed by an explicit startPolling(). This must not stand up a + // replacement runner alongside the live one. + executor.startPolling(); + assertSame(runner, executor.getTaskRunner()); + + executor.shutdown(); + } + + @Test + @DisplayName("startPolling should be a no-op while the worker set is unchanged") + void startPollingIsIdempotent() { + var executor = new AnnotatedWorkerExecutor(mock(TaskClient.class)); + executor.addBean(new MultipleInputParams()); + + executor.startPolling(); + var first = executor.getTaskRunner(); + assertNotNull(first); + + executor.startPolling(); + executor.startPolling(); + assertSame(first, executor.getTaskRunner()); + + executor.shutdown(); + } + + @Test + @DisplayName("startPolling should still rebuild the task runner once new workers are added") + void startPollingRebuildsWhenWorkersAreAdded() { + var executor = new AnnotatedWorkerExecutor(mock(TaskClient.class)); + executor.addBean(new MultipleInputParams()); + executor.startPolling(); + var first = executor.getTaskRunner(); + assertEquals(1, first.getWorkerCount()); + + executor.addBean(new AnotherAnnotationInput()); + executor.startPolling(); + var second = executor.getTaskRunner(); + + assertNotSame(first, second); + assertEquals(2, second.getWorkerCount()); + + executor.shutdown(); + } + + @Test + @DisplayName("startPolling should build a fresh task runner after a shutdown") + void startPollingRestartsAfterShutdown() { + var executor = new AnnotatedWorkerExecutor(mock(TaskClient.class)); + executor.addBean(new MultipleInputParams()); + executor.startPolling(); + var first = executor.getTaskRunner(); + assertNotNull(first); + + // A TaskRunnerConfigurer is single-use, so shutdown() has to clear the field as well as + // shut the runner down. Otherwise startPolling()'s idempotence check sees a non-null + // runner with an unchanged worker set and silently declines to poll ever again. + executor.shutdown(); + assertNull(executor.getTaskRunner()); + + executor.startPolling(); + var second = executor.getTaskRunner(); + assertNotNull(second); + assertNotSame(first, second); + assertEquals(1, second.getWorkerCount()); + + executor.shutdown(); + } + @Test @DisplayName("it should handle null values when InputParam is a List") void nullListAsInputParam() throws NoSuchMethodException { diff --git a/scripts/docker-compose-oss.yaml b/scripts/docker-compose-oss.yaml new file mode 100644 index 000000000..a30a91e7c --- /dev/null +++ b/scripts/docker-compose-oss.yaml @@ -0,0 +1,43 @@ +# Conductor OSS stack used to run the SDK integration tests against open-source Conductor. +# Shared by scripts/run-integration-oss.sh and the integration-tests-oss job in +# .github/workflows/integration-tests.yml. +# +# The `image:` default below is the SINGLE place the Conductor OSS image tag is written. +# Everything that does not override OSS_CONDUCTOR_VERSION lands on it: a plain +# scripts/run-integration-oss.sh run, and the integration-tests-oss job on a fork PR (where +# GitHub withholds org variables). Overrides are the script's --version flag and, in CI, the +# E2E_TEST_OSS_CONDUCTOR_VERSION org variable or a workflow_dispatch input. Bump the tag here +# and both follow. +# +# Note that the org variable is currently set to `latest`, so a normal CI run still tracks +# whatever `latest` resolves to at run time. Set it to a real tag if the job needs to be +# deterministic; until then this default is what actually pins fork PRs and local runs. + +services: + conductor-server: + image: conductoross/conductor:${OSS_CONDUCTOR_VERSION:-3.32.3} + environment: + - CONFIG_PROP=config-postgres.properties + ports: + - "8080:8080" + healthcheck: + test: ["CMD", "curl", "-I", "-XGET", "http://localhost:8080/health"] + interval: 10s + timeout: 10s + retries: 20 + links: + - conductor-postgres:postgresdb + depends_on: + conductor-postgres: + condition: service_healthy + + conductor-postgres: + image: postgres:16 + environment: + - POSTGRES_USER=conductor + - POSTGRES_PASSWORD=conductor + healthcheck: + test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' + interval: 5s + timeout: 5s + retries: 12 diff --git a/scripts/run-integration-oss.sh b/scripts/run-integration-oss.sh new file mode 100755 index 000000000..8b624b1d2 --- /dev/null +++ b/scripts/run-integration-oss.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +# +# Spin up a local Conductor OSS stack and run the `tests` module's +# integration suite against it, mirroring the `integration-tests-oss` job in +# .github/workflows/integration-tests.yml. Orkes-Enterprise-only test +# classes are annotated with +# @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss") +# so they skip themselves when it's set (see the individual test files for +# the empirically-confirmed gaps). +# +# The stack (Conductor OSS + Postgres) is defined in +# scripts/docker-compose-oss.yaml and is torn down automatically on exit. That +# file's `image:` line is also where the default tag lives -- this script +# applies no default of its own, so a plain run and a fork-PR CI run land on +# the identical image. The image is always pulled before starting, since a tag +# can be mutable and a cached copy would otherwise go stale silently. +# +# Usage: +# scripts/run-integration-oss.sh [--keep-up] [--version ] [--include-gated] [-- gradle args] +# Examples: +# scripts/run-integration-oss.sh # default tag from the compose file +# scripts/run-integration-oss.sh --version 3.33.0-rc1 +# scripts/run-integration-oss.sh --keep-up +# scripts/run-integration-oss.sh --include-gated # also run tests normally skipped as Orkes-only +# scripts/run-integration-oss.sh -- --tests "*WorkflowClientTests" +set -euo pipefail + +KEEP_UP=0 +INCLUDE_GATED=0 +extra=() + +while [[ $# -gt 0 ]]; do + case "$1" in + --keep-up) KEEP_UP=1; shift ;; + --version) OSS_CONDUCTOR_VERSION="${2:?--version needs a tag}"; shift 2 ;; + --include-gated) INCLUDE_GATED=1; shift ;; + -h|--help) + echo "Usage: $0 [--keep-up] [--version ] [--include-gated] [-- gradle args]" + exit 0 + ;; + --) shift; extra=("$@"); break ;; + *) echo "Unknown argument: $1" >&2; exit 1 ;; + esac +done + +# No default is applied here on purpose. The default tag is written once, in the +# `image:` line of scripts/docker-compose-oss.yaml, so leaving OSS_CONDUCTOR_VERSION +# unset lets compose supply it -- the same path a fork PR takes in CI. Only export +# it when the caller actually asked for a specific tag, otherwise a value set but +# not exported in the caller's shell would never reach compose anyway. +if [[ -n "${OSS_CONDUCTOR_VERSION:-}" ]]; then + export OSS_CONDUCTOR_VERSION +fi + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +COMPOSE_FILE="${SCRIPT_DIR}/docker-compose-oss.yaml" +cd "${REPO_ROOT}" + +compose() { docker compose -f "${COMPOSE_FILE}" "$@"; } + +cleanup() { + local status=$? + if [[ "${status}" -ne 0 ]]; then + echo "Dumping conductor-server logs (exit ${status})..." >&2 + compose logs conductor-server || true + fi + if [[ "${KEEP_UP}" == "1" ]]; then + echo "--keep-up set: leaving the OSS stack running. Tear down with:" + echo " docker compose -f ${COMPOSE_FILE} down -v" + return + fi + echo "Tearing down Conductor OSS stack..." + compose down -v || true +} +trap cleanup EXIT + +# Ask compose what it resolved rather than reconstructing the tag here, so this +# stays correct whether the tag came from --version or from the compose default. +# `--images` lists every service's image and does not reliably honour a service +# filter, so select the server's by name rather than by position. +SERVER_IMAGE="$(compose config --images | grep -m1 '^conductoross/conductor:')" +echo "Using ${SERVER_IMAGE}" + +# `docker compose up` only pulls an image when it is missing locally, so a +# previously-cached mutable tag (a re-pushed rc, or `latest` if that is what was +# asked for) would silently be reused instead of getting the current version. +# Pull unconditionally so the stack always reflects the tag we just printed. +echo "Pulling ${SERVER_IMAGE} to ensure it's current..." +compose pull conductor-server + +echo "Starting Conductor OSS stack..." +compose up -d + +echo "Waiting for Conductor to be healthy..." +HEALTH_TIMEOUT="${HEALTH_TIMEOUT:-180}" +deadline=$(( SECONDS + HEALTH_TIMEOUT )) +until curl -sf http://localhost:8080/health >/dev/null 2>&1; do + if (( SECONDS >= deadline )); then + echo "Error: Conductor did not become healthy within ${HEALTH_TIMEOUT}s." >&2 + exit 1 + fi + sleep 5 +done +echo "Conductor is up." + +export CONDUCTOR_SERVER_URL="http://localhost:8080/api" + +# Plain OSS Conductor has no authentication layer and no /token endpoint. ClientTestUtil builds +# its client with useEnvVariables(true), and ApiClient.applyEnvVariables() attaches credentials +# whenever both of these are present -- so a shell that still has them exported for the Orkes +# suite would send the whole run through an auth flow the local server cannot serve. +unset CONDUCTOR_AUTH_KEY CONDUCTOR_AUTH_SECRET +unset CONDUCTOR_SERVER_AUTH_KEY CONDUCTOR_SERVER_AUTH_SECRET + +if [[ "${INCLUDE_GATED}" == "1" ]]; then + echo "--include-gated set: leaving CONDUCTOR_SERVER_TYPE unset, so tests normally" \ + "skipped as Orkes-only will run against OSS too." + unset CONDUCTOR_SERVER_TYPE || true +else + export CONDUCTOR_SERVER_TYPE="oss" +fi + + +# --rerun-tasks: the `test` task's up-to-date check only considers the compiled +# test classpath, not env vars like CONDUCTOR_SERVER_URL/CONDUCTOR_SERVER_TYPE +# or the state of the live server underneath. Without this, Gradle can report +# BUILD SUCCESSFUL while silently reusing a stale cached result from a +# previous run against a different server/tag/gating state instead of +# actually executing anything. +./gradlew :tests:test -PIntegrationTests --rerun-tasks ${extra[@]+"${extra[@]}"} diff --git a/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java b/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java index 76922097e..64fc95d0f 100644 --- a/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java @@ -19,6 +19,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.model.OrkesCircuitBreakerConfig; import com.netflix.conductor.common.model.ServiceMethod; @@ -30,6 +31,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") public class ServiceRegistryClientTest { private static final String PROTO_FILENAME = "compiled.bin"; diff --git a/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java b/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java index e3793c077..739367075 100644 --- a/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java @@ -18,6 +18,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.metadata.tasks.TaskDef; import com.netflix.conductor.common.metadata.tasks.TaskResult; @@ -36,6 +37,8 @@ import lombok.extern.slf4j.Slf4j; @Slf4j +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "workflowClient.uploadCompletedWorkflows() (/workflow/document-store/upload) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/document-store/upload')") public class WorkflowRetryTest { private final OrkesMetadataClient metadataClient; private final OrkesWorkflowClient workflowClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java index d40e829bc..fa896a45d 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java @@ -25,6 +25,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; @@ -49,6 +50,8 @@ import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the Authorization APIs (applications/users/groups/roles/permissions) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/applications|users|groups|...')") public class AuthorizationClientTests { private static AuthorizationClient authorizationClient; private static String applicationId; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java index 6dd0e3359..d1de9535b 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java @@ -19,11 +19,14 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import java.util.List; import java.util.Optional; import java.util.UUID; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "environment variable writes are not supported by plain OSS Conductor, confirmed empirically: OSS added read-only GET /environment in 3.32.0-rc.9 but PUT /environment/{key} still 405s ('Request method 'PUT' is not supported')") public class EnvironmentClientTests { private static EnvironmentClient envClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java index c1e21d90b..104e13ca5 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java @@ -24,6 +24,7 @@ import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.TestUtil; public class EventClientTests { private static final String EVENT_NAME = "test_sdk_java_event_name"; @@ -35,9 +36,9 @@ void testEventHandler() { try { eventClient.unregisterEventHandler(EVENT_NAME); } catch (ConductorClientException e) { - if (e.getStatus() != 404) { - throw e; - } + // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server + // we're running against actually reports it. + TestUtil.tolerateNotFound(e, "EventHandler with name"); } EventHandler eventHandler = getEventHandler(); eventClient.registerEventHandler(eventHandler); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java index 836dfd110..6754cfb15 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.tasks.TaskDef; @@ -38,9 +39,9 @@ void taskDefinition() { try { metadataClient.unregisterTaskDef(Commons.TASK_NAME); } catch (ConductorClientException e) { - if (e.getStatus() != 404) { - throw e; - } + // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server + // we're running against actually reports it. + TestUtil.tolerateNotFound(e, "No such task definition"); } TaskDef taskDef = Commons.getTaskDef(); metadataClient.registerTaskDefs(List.of(taskDef)); @@ -54,9 +55,9 @@ void workflow() { try { metadataClient.unregisterWorkflowDef(Commons.WORKFLOW_NAME, Commons.WORKFLOW_VERSION); } catch (ConductorClientException e) { - if (e.getStatus() != 404) { - throw e; - } + // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server + // we're running against actually reports it. + TestUtil.tolerateNotFound(e, "No such workflow definition"); } metadataClient.registerTaskDefs(List.of(Commons.getTaskDef())); WorkflowDef workflowDef = WorkflowUtil.getWorkflowDef(); @@ -73,6 +74,8 @@ void workflow() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "task tagging (/metadata/task/{name}/tags) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/metadata/task/{name}/tags')") void tagTask() throws Exception { metadataClient.registerTaskDefs(List.of(Commons.getTaskDef())); try { @@ -98,6 +101,8 @@ void tagTask() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "workflow tagging (/metadata/workflow/{name}/tags) is not implemented by plain OSS Conductor, confirmed empirically (the {version} path segment ends up matching the literal string \"tags\" instead, a server-side routing collision)") void tagWorkflow() { TagObject tagObject = Commons.getTagObject(); try { diff --git a/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java index 53d427232..2ce260590 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java @@ -20,6 +20,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; @@ -32,6 +33,8 @@ import org.conductoross.conductor.client.model.ai.PromptTemplate; import io.orkes.conductor.client.util.ClientTestUtil; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the Prompts and Integrations APIs (/prompts, /integrations) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/prompts|integrations/...')") public class PromptClientTests { private static final String PROMPT_NAME = "test-sdk-java-prompt"; private static final String PROMPT_DESCRIPTION = "Test prompt for Java SDK"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java index f86c332d2..9bbc030a7 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java @@ -16,6 +16,7 @@ import java.util.UUID; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.model.BulkResponse; @@ -51,6 +52,10 @@ void afterEach() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "GET /scheduler/search does not 404 on plain OSS Conductor, but confirmed empirically to " + + "always return zero results (even after polling for 30s) -- schedules aren't surfaced via search " + + "on plain OSS the way they are on Orkes Enterprise") void testMethods() { schedulerClient.deleteSchedule(SCHEDULE_1); Assertions.assertTrue(schedulerClient.getNextFewSchedules(CRON_EXPRESSION_1, 0L, 0L, 0).isEmpty()); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java index b74b318fc..8dd145160 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java @@ -17,6 +17,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.SchemaDef; @@ -24,6 +25,8 @@ import io.orkes.conductor.client.SchemaClient; import io.orkes.conductor.client.util.ClientTestUtil; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the Schema API (/schema) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/schema')") public class SchemaClientTests { private static final String SCHEMA_NAME = "test-sdk-java-schema"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java index 1a8daecf8..33ce31ee7 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; @@ -24,6 +25,8 @@ import io.orkes.conductor.client.util.ClientTestUtil; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "secret writes are not supported by plain OSS Conductor, confirmed empirically: its env-var-backed secrets DAO is read-only, so putSecret() 501s ('env-backed secrets are read-only')") public class SecretClientTests { private final String SECRET_NAME = "test-sdk-java-secret_name"; private final String SECRET_KEY = "test-sdk-java-secret_key"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java index d5253fd8a..a09ba6c85 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java @@ -18,6 +18,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.model.CircuitBreakerTransitionResponse; @@ -32,6 +33,8 @@ import static org.junit.jupiter.api.Assertions.assertNull; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") public class ServiceRegistryClientTests { private static final String SERVICE_NAME = "test-sdk-java-service"; private static final String SERVICE_URI = "localhost:50051"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java index 22f9098e7..bfc0bc0d0 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java @@ -30,6 +30,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.testcontainers.shaded.com.google.common.util.concurrent.Uninterruptibles; @@ -146,6 +147,8 @@ public void testUpdateByRefName() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the sync task-update endpoint (POST /tasks/{workflowId}/{taskRefName}/{status}/sync) never returns the updated workflow on plain OSS Conductor, confirmed empirically (caller times out waiting for terminal status)") public void testUpdateByRefNameSync() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); @@ -332,6 +335,8 @@ private void completeWorkflow(String workflowId) throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testSyncTargetWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.TARGET_WORKFLOW); @@ -346,6 +351,8 @@ void testSyncTargetWorkflow() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testSyncBlockingWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_WORKFLOW); @@ -360,6 +367,8 @@ void testSyncBlockingWorkflow() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testSyncBlockingTask() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK); @@ -374,6 +383,8 @@ void testSyncBlockingTask() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "BLOCKING_TASK_LIST is not a value of the server-side WorkflowSignalReturnStrategy enum in any OSS Conductor release, so OSS rejects the returnStrategy parameter outright, on top of not implementing the signal/sync API the other BLOCKING_* tests are skipped for") void testSyncBlockingTaskList() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK_LIST); @@ -391,6 +402,8 @@ void testSyncBlockingTaskList() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testSyncBlockingTaskInput() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK_INPUT); @@ -408,7 +421,10 @@ void testSyncBlockingTaskInput() throws Exception { private static final String REGION_DURABLE_ENABLED = "CONDUCTOR_REGION_DURABLE_ENABLED"; @Test - @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true") + @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", + disabledReason = "target server has no region replication configured") + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testDurableTargetWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.TARGET_WORKFLOW); @@ -423,7 +439,10 @@ void testDurableTargetWorkflow() throws Exception { } @Test - @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true") + @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", + disabledReason = "target server has no region replication configured") + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testDurableBlockingWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.BLOCKING_WORKFLOW); @@ -438,6 +457,8 @@ void testDurableBlockingWorkflow() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testDurableBlockingTask() throws Exception { String workflowId = startComplexWorkflow(Consistency.DURABLE, ReturnStrategy.BLOCKING_TASK); @@ -452,7 +473,10 @@ void testDurableBlockingTask() throws Exception { } @Test - @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true") + @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", + disabledReason = "target server has no region replication configured") + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testDurableBlockingTaskInput() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.BLOCKING_TASK_INPUT); @@ -467,6 +491,8 @@ void testDurableBlockingTaskInput() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") void testDefaultReturnStrategy() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.TARGET_WORKFLOW); @@ -745,6 +771,8 @@ void testRequeuePendingTasksByTaskType() { // ==================== Search Tests ==================== @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "GET /tasks/search fails on plain OSS Conductor with a Postgres persistence layer, confirmed empirically (ERROR: column \"workflow_id\" does not exist)") void testSearchTasks() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); @@ -781,6 +809,8 @@ void testSearchV2Tasks() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "GET /tasks/search fails on plain OSS Conductor with a Postgres persistence layer, confirmed empirically (ERROR: column \"workflow_id\" does not exist)") void testPaginatedSearchTasks() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java b/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java index 06b2f25dc..7f6ed98db 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java @@ -16,11 +16,14 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import io.orkes.conductor.client.model.GenerateTokenRequest; import io.orkes.conductor.client.model.TokenResponse; import io.orkes.conductor.client.util.ClientTestUtil; +@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "the auth Token API (/token) is not implemented by plain OSS Conductor (which has no authentication layer), confirmed empirically (404 'No static resource api/token')") public class TokenClientTest { public static OrkesTokenClient tokenClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java index a8d906940..c4c5e8e13 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.metadata.tasks.TaskDef; import com.netflix.conductor.common.metadata.tasks.TaskResult; @@ -102,6 +103,8 @@ public void startWorkflow() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "batch correlation-id search (POST /workflow/correlated/batch) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/correlated/batch')") public void testSearchByCorrelationIds() { List correlationIds = new ArrayList<>(); Set workflowNames = new HashSet<>(); @@ -188,6 +191,8 @@ public void testSkipTaskFromWorkflow() throws Exception { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "POST /workflow/{workflowId}/variables is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/variables')") public void testUpdateVariables() { ConductorWorkflow workflow = new ConductorWorkflow<>(workflowExecutor); workflow.add(new SimpleTask("simple_task", "simple_task_ref")); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java index 286d428a5..0faad3086 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java @@ -22,6 +22,7 @@ import org.conductoross.conductor.common.model.WorkflowRun; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.tasks.Task; @@ -91,6 +92,8 @@ public String startWorkflow() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "POST /workflow/{workflowId}/state (updateWorkflow) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/state')") public void test() { String workflowId = startWorkflow(); System.out.println(workflowId); @@ -135,6 +138,8 @@ public void test() { } @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "workflow start idempotency keys are not honored by plain OSS Conductor, confirmed empirically (RETURN_EXISTING starts a brand-new run instead of returning the original workflowId)") public void testIdempotency() { StartWorkflowRequest startWorkflowRequest = new StartWorkflowRequest(); startWorkflowRequest.setName("sync_task_variable_updates"); diff --git a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java index 65b13f72e..bbb77c76d 100644 --- a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java +++ b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java @@ -19,6 +19,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.TimeoutException; +import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.config.ObjectMapperProvider; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; import com.netflix.conductor.common.run.Workflow; @@ -160,4 +161,26 @@ private static boolean isTerminalFailure(Workflow workflow) { return workflow.getStatus() == Workflow.WorkflowStatus.FAILED || workflow.getStatus() == Workflow.WorkflowStatus.TERMINATED; } + + /** + * Tolerates a caught exception that represents "resource doesn't exist", in either shape a + * Conductor server reports it in: a proper 404, or -- on plain OSS Conductor, for the + * endpoints where this has been empirically confirmed -- a 500 whose message contains + * {@code ossMessageSubstring}. Anything else is rethrown, since it isn't the "doesn't exist" + * case this is meant to tolerate. + * + *

Both shapes are accepted regardless of {@code CONDUCTOR_SERVER_TYPE}. Keying off that + * variable would break two ways: {@code run-integration-oss.sh --include-gated} runs against + * OSS with it deliberately unset, and OSS returning a correct 404 for one of these endpoints + * should not start failing the suite. + */ + public static void tolerateNotFound(ConductorClientException e, String ossMessageSubstring) { + if (e.getStatus() == 404) { + return; + } + if (e.getStatus() == 500 && e.getMessage() != null && e.getMessage().contains(ossMessageSubstring)) { + return; + } + throw e; + } } diff --git a/tests/src/test/java/io/orkes/conductor/sdk/WorkflowSDKTests.java b/tests/src/test/java/io/orkes/conductor/sdk/WorkflowSDKTests.java index 452da6872..391cfd926 100644 --- a/tests/src/test/java/io/orkes/conductor/sdk/WorkflowSDKTests.java +++ b/tests/src/test/java/io/orkes/conductor/sdk/WorkflowSDKTests.java @@ -14,9 +14,7 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -38,11 +36,15 @@ public class WorkflowSDKTests { @Test - public void testCreateWorkflow() { + public void testCreateWorkflow() throws Exception { ConductorClient client = ClientTestUtil.getClient(); AnnotatedWorkerExecutor workerExecutor = new AnnotatedWorkerExecutor(new TaskClient(client), new WorkerConfiguration()); workerExecutor.initWorkers("io.orkes.conductor.sdk"); + // Redundant -- initWorkers() already reaches startPolling() -- but kept deliberately: this is + // the shape the docs and examples use, and startPolling() is now idempotent, so it must not + // restart the runner out from under an in-flight poll. See + // AnnotatedWorkerTests#initWorkersStartsASingleTaskRunner. workerExecutor.startPolling(); WorkflowExecutor executor = new WorkflowExecutor(client, workerExecutor); @@ -57,11 +59,14 @@ public void testCreateWorkflow() { CompletableFuture result = workflow.execute(Map.of("name", "orkes")); Assertions.assertNotNull(result); try { - Workflow executedWorkflow = result.get(3, TimeUnit.SECONDS); + // WorkflowExecutor's monitor thread polls every 100ms (see initMonitor()), so 10s is a generous margin. + Workflow executedWorkflow = result.get(10, TimeUnit.SECONDS); Assertions.assertNotNull(executedWorkflow); Assertions.assertEquals(Workflow.WorkflowStatus.COMPLETED, executedWorkflow.getStatus()); - } catch (InterruptedException | ExecutionException | TimeoutException e) { - Assertions.fail(e.getMessage()); + } catch (Exception e) { + // fail(e), not fail(e.getMessage()): a TimeoutException carries a null message, which + // previously surfaced in CI as a bare AssertionFailedError with nothing to diagnose. + Assertions.fail(e); } } From b3dab811d25f1c837089add34f8383c27babafa3 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 10:00:13 -0600 Subject: [PATCH 02/14] fix(examples): healthcheck hello-world Conductor with wget, always pull conductoross/conductor 3.34.0 moved to an Alpine base that ships busybox wget but no curl, so the curl healthcheck never passes, the container is marked unhealthy, and the hello-world service (service_healthy) never starts. This fails the "Documentation validation" smoke test. Use wget against 127.0.0.1 (busybox wget does not fall back from ::1), and set pull_policy: always so a pre-3.34.0 `latest` cached locally, which has curl but not wget, is replaced before the healthcheck runs. Co-Authored-By: Claude Opus 5.5 --- examples/basics/hello-world/docker-compose.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/basics/hello-world/docker-compose.yml b/examples/basics/hello-world/docker-compose.yml index 61b7c07d9..1a2f82c31 100644 --- a/examples/basics/hello-world/docker-compose.yml +++ b/examples/basics/hello-world/docker-compose.yml @@ -1,11 +1,16 @@ services: conductor: image: conductoross/conductor:latest + # Always re-pull so a stale local `latest` can't outlive the healthcheck + # below: images before 3.34.0 ship curl but not wget. + pull_policy: always ports: - "${CONDUCTOR_PORT:-8080}:8080" - "${CONDUCTOR_UI_PORT:-1234}:5000" healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + # 127.0.0.1, not localhost: busybox wget tries ::1 first and does not + # fall back to the IPv4-bound server. + test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/health"] interval: 5s timeout: 5s retries: 12 From 0c61f4fbc61d063effe3b242ad44013a8436b529 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 10:03:23 -0600 Subject: [PATCH 03/14] ci: cache Gradle dependencies in build, integration and agent-e2e jobs None of the setup-java steps set `cache:`, so every job downloaded the full Gradle dependency set from Maven Central on each run. Add `cache: gradle` to each setup-java step that runs Gradle on PR and test paths. publish-release.yml is left uncached so releases always build from freshly resolved dependencies. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/agent-e2e.yml | 1 + .github/workflows/ci.yml | 2 ++ .github/workflows/integration-tests.yml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/agent-e2e.yml b/.github/workflows/agent-e2e.yml index e818db1dd..0df3ac54a 100644 --- a/.github/workflows/agent-e2e.yml +++ b/.github/workflows/agent-e2e.yml @@ -77,6 +77,7 @@ jobs: with: distribution: temurin java-version: '21' + cache: gradle # Python is only needed for mcp-testkit and the XML guard. # No `cache: pip` — it hard-fails without a requirements file. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecca05d7a..6713b341e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: with: distribution: "zulu" java-version: "21" + cache: gradle - name: Validate documentation links uses: lycheeverse/lychee-action@v2 @@ -133,6 +134,7 @@ jobs: with: distribution: "zulu" java-version: "21" + cache: gradle - name: Build id: build diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 2d82efae7..2bed4ca7c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -54,6 +54,7 @@ jobs: with: distribution: "zulu" java-version: "21" + cache: gradle - name: Run Integration tests run: | ./gradlew test -PIntegrationTests @@ -146,6 +147,7 @@ jobs: with: distribution: "zulu" java-version: "21" + cache: gradle # `docker compose up` only pulls an image when it is missing locally. On a # GitHub-hosted runner the VM is ephemeral and starts with no cached copy From d45fb54cd2c4ab777e308c0b603c0e70924604cc Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 11:05:35 -0600 Subject: [PATCH 04/14] Revert "ci: cache Gradle dependencies in build, integration and agent-e2e jobs" This reverts commit 0c61f4fbcab9a8c3b3bc4fcfa57a76f5df3ba4fe. Out of scope for this PR; the Gradle cache change will go separately. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/agent-e2e.yml | 1 - .github/workflows/ci.yml | 2 -- .github/workflows/integration-tests.yml | 2 -- 3 files changed, 5 deletions(-) diff --git a/.github/workflows/agent-e2e.yml b/.github/workflows/agent-e2e.yml index 0df3ac54a..e818db1dd 100644 --- a/.github/workflows/agent-e2e.yml +++ b/.github/workflows/agent-e2e.yml @@ -77,7 +77,6 @@ jobs: with: distribution: temurin java-version: '21' - cache: gradle # Python is only needed for mcp-testkit and the XML guard. # No `cache: pip` — it hard-fails without a requirements file. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6713b341e..ecca05d7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: with: distribution: "zulu" java-version: "21" - cache: gradle - name: Validate documentation links uses: lycheeverse/lychee-action@v2 @@ -134,7 +133,6 @@ jobs: with: distribution: "zulu" java-version: "21" - cache: gradle - name: Build id: build diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 2bed4ca7c..2d82efae7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -54,7 +54,6 @@ jobs: with: distribution: "zulu" java-version: "21" - cache: gradle - name: Run Integration tests run: | ./gradlew test -PIntegrationTests @@ -147,7 +146,6 @@ jobs: with: distribution: "zulu" java-version: "21" - cache: gradle # `docker compose up` only pulls an image when it is missing locally. On a # GitHub-hosted runner the VM is ephemeral and starts with no cached copy From af99e4df3c08e1ff221b1056362f0a9ed4d6d587 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 11:11:50 -0600 Subject: [PATCH 05/14] fix(sdk): fail a monitored workflow only after 1 minute of failed polls The completion monitor failed a workflow's future on the first getWorkflow error, so a brief server restart or network blip failed callers whose workflows were still running. Track when each workflow's current run of failed polls started, and complete its future exceptionally only after polls have failed continuously for one minute. A successful poll resets the clock. Warn once per run of failures and log at DEBUG after that, since the 100 ms poll interval would otherwise log a WARN on every tick during an outage. Tests shorten the timeout through a package-private setter. Also correct docs that said the E2E_TEST_OSS_CONDUCTOR_VERSION org variable is set to `latest`, and that the local default tag is `latest`. Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTING.md | 8 +-- .../workflow/executor/WorkflowExecutor.java | 43 +++++++++++-- .../WorkflowExecutorMonitorTests.java | 60 +++++++++++++++++-- scripts/docker-compose-oss.yaml | 5 +- 4 files changed, 100 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7876321c5..32bcdefcd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,16 +32,16 @@ Postgres stack (defined in `scripts/docker-compose-oss.yaml`), waits for `/healt integration suite, and tears the stack down on exit. ```shell -scripts/run-integration-oss.sh # against `latest` +scripts/run-integration-oss.sh # against the default tag in scripts/docker-compose-oss.yaml scripts/run-integration-oss.sh --version 3.32.0-rc18 scripts/run-integration-oss.sh --keep-up # leave the stack running afterwards scripts/run-integration-oss.sh --include-gated # also run tests normally skipped as Orkes-only ``` The script always prints the resolved `conductoross/conductor` tag and pulls it before -starting the stack, since `latest` (the local default) is a mutable tag — without an -explicit pull, `docker compose up` would silently reuse a stale cached image instead of -fetching the current one. It also always runs Gradle with `--rerun-tasks`, since the `test` +starting the stack, since a tag can be re-pushed (an rc, or `latest` via `--version latest`) — +without an explicit pull, `docker compose up` would silently reuse a stale cached image +instead of fetching the current one. It also always runs Gradle with `--rerun-tasks`, since the `test` task's up-to-date check doesn't account for env vars like `CONDUCTOR_SERVER_TYPE` or the state of the live server underneath — without it, a rerun after changing gating or switching server versions could silently report a stale cached result instead of executing anything. diff --git a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java index f185e6e6d..d975e18ab 100644 --- a/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java +++ b/conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -80,6 +81,19 @@ public class WorkflowExecutor { private final Map> runningWorkflowFutures = new ConcurrentHashMap<>(); + /** + * How long a workflow's polls must keep failing before the monitor stops tracking it and fails + * its future. Long enough for a server restart or failover to pass without failing workflows + * that are still running. + */ + static final long DEFAULT_POLL_FAILURE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(1); + + private volatile long pollFailureTimeoutMillis = DEFAULT_POLL_FAILURE_TIMEOUT_MILLIS; + + // When each workflow's current run of failed polls started, in System.nanoTime() units. + // Only accessed from the single monitor thread. + private final Map pollFailingSinceNanos = new HashMap<>(); + private final ObjectMapper objectMapper = new ObjectMapperProvider().getObjectMapper(); private final TaskClient taskClient; @@ -176,6 +190,7 @@ private void initMonitor() { CompletableFuture future = entry.getValue(); try { Workflow workflow = workflowClient.getWorkflow(workflowId, true); + pollFailingSinceNanos.remove(workflowId); if (workflow.getStatus().isTerminal()) { future.complete(workflow); runningWorkflowFutures.remove(workflowId); @@ -183,10 +198,25 @@ private void initMonitor() { } catch (Exception e) { // scheduleAtFixedRate silently kills all future ticks on any uncaught // exception, so this must not escape: one failed poll would otherwise - // stop completion tracking for every workflow, forever. Stop tracking - // this one and let its caller see the failure. - LOGGER.error("Error polling workflow {} for completion; completing its " - + "future exceptionally", workflowId, e); + // stop completion tracking for every workflow, forever. + long now = System.nanoTime(); + Long failingSince = pollFailingSinceNanos.putIfAbsent(workflowId, now); + if (failingSince == null) { + LOGGER.warn("Error polling workflow {} for completion; will retry for up " + + "to {} ms: {}", workflowId, pollFailureTimeoutMillis, e.getMessage()); + continue; + } + long failingForMillis = TimeUnit.NANOSECONDS.toMillis(now - failingSince); + if (failingForMillis < pollFailureTimeoutMillis) { + // Already warned for this run of failures; at the polling interval a + // WARN per tick would flood the log during an outage. + LOGGER.debug("Still failing to poll workflow {} for completion ({} ms so " + + "far): {}", workflowId, failingForMillis, e.getMessage()); + continue; + } + LOGGER.error("Polling workflow {} for completion has failed for {} ms; " + + "completing its future exceptionally", workflowId, failingForMillis, e); + pollFailingSinceNanos.remove(workflowId); runningWorkflowFutures.remove(workflowId); future.completeExceptionally(e); } @@ -197,6 +227,11 @@ private void initMonitor() { TimeUnit.MILLISECONDS); } + // Lets tests shorten the timeout instead of waiting out the default. + void setPollFailureTimeoutMillis(long pollFailureTimeoutMillis) { + this.pollFailureTimeoutMillis = pollFailureTimeoutMillis; + } + public void initWorkers(String... packagesToScan) { annotatedWorkerExecutor.initWorkers(packagesToScan); } diff --git a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java index 56f684ac4..b28f847ec 100644 --- a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java +++ b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutorMonitorTests.java @@ -16,6 +16,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -30,6 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyString; @@ -48,31 +50,79 @@ public class WorkflowExecutorMonitorTests { private static final String OTHER_WORKFLOW_ID = "other-test-workflow-id"; + // Stands in for the one-minute default so the tests need not wait it out. + private static final long TEST_POLL_FAILURE_TIMEOUT_MILLIS = 1000; + private WorkflowExecutor executorFor(WorkflowClient workflowClient) { - return new WorkflowExecutor( + WorkflowExecutor executor = new WorkflowExecutor( mock(TaskClient.class), workflowClient, mock(MetadataClient.class), mock(AnnotatedWorkerExecutor.class)); + executor.setPollFailureTimeoutMillis(TEST_POLL_FAILURE_TIMEOUT_MILLIS); + return executor; } @Test - @DisplayName("a failed poll should complete that workflow's future exceptionally") - void monitorFailsTheFutureOnPollFailure() { + @DisplayName("polls failing for the whole timeout should complete that workflow's future exceptionally") + void monitorFailsTheFutureOnPersistentPollFailure() throws Exception { + AtomicInteger polls = new AtomicInteger(); WorkflowClient workflowClient = mock(WorkflowClient.class); when(workflowClient.startWorkflow(any(StartWorkflowRequest.class))).thenReturn(WORKFLOW_ID); - when(workflowClient.getWorkflow(anyString(), anyBoolean())) - .thenThrow(new RuntimeException("poll failure")); + when(workflowClient.getWorkflow(anyString(), anyBoolean())).thenAnswer(invocation -> { + polls.incrementAndGet(); + throw new RuntimeException("poll failure"); + }); WorkflowExecutor executor = executorFor(workflowClient); try { + long start = System.nanoTime(); CompletableFuture future = executor.executeWorkflow("wf", 1, Map.of()); ExecutionException thrown = assertThrows( ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); + long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); assertInstanceOf(RuntimeException.class, thrown.getCause()); assertEquals("poll failure", thrown.getCause().getMessage()); + assertTrue(elapsedMillis >= TEST_POLL_FAILURE_TIMEOUT_MILLIS, + "future failed after " + elapsedMillis + " ms, before the timeout"); + // The workflow is untracked before its future fails, so no further polls can follow. + int pollsAtFailure = polls.get(); + Thread.sleep(300); + assertEquals(pollsAtFailure, polls.get()); + } finally { + executor.shutdown(); + } + } + + @Test + @DisplayName("poll failures shorter than the timeout should not fail the future, and a success resets it") + void monitorToleratesTransientPollFailures() throws Exception { + Workflow running = new Workflow(); + running.setStatus(Workflow.WorkflowStatus.RUNNING); + Workflow completed = new Workflow(); + completed.setStatus(Workflow.WorkflowStatus.COMPLETED); + + // Two runs of failures, each spanning ~600 ms of 100 ms ticks (short of the 1 s timeout), + // separated by a single successful poll. Together they span ~1.4 s, past the timeout, so + // the future completes only if that success reset the clock. + int burst = 7; + AtomicInteger calls = new AtomicInteger(); + WorkflowClient workflowClient = mock(WorkflowClient.class); + when(workflowClient.startWorkflow(any(StartWorkflowRequest.class))).thenReturn(WORKFLOW_ID); + when(workflowClient.getWorkflow(anyString(), anyBoolean())).thenAnswer(invocation -> { + int call = calls.incrementAndGet(); + if (call <= burst || (call > burst + 1 && call <= 2 * burst + 1)) { + throw new RuntimeException("transient poll failure"); + } + return call == burst + 1 ? running : completed; + }); + + WorkflowExecutor executor = executorFor(workflowClient); + try { + CompletableFuture future = executor.executeWorkflow("wf", 1, Map.of()); + assertEquals(Workflow.WorkflowStatus.COMPLETED, future.get(10, TimeUnit.SECONDS).getStatus()); } finally { executor.shutdown(); } diff --git a/scripts/docker-compose-oss.yaml b/scripts/docker-compose-oss.yaml index a30a91e7c..50d830718 100644 --- a/scripts/docker-compose-oss.yaml +++ b/scripts/docker-compose-oss.yaml @@ -9,9 +9,8 @@ # E2E_TEST_OSS_CONDUCTOR_VERSION org variable or a workflow_dispatch input. Bump the tag here # and both follow. # -# Note that the org variable is currently set to `latest`, so a normal CI run still tracks -# whatever `latest` resolves to at run time. Set it to a real tag if the job needs to be -# deterministic; until then this default is what actually pins fork PRs and local runs. +# The org variable is set independently of this default, so a normal CI run can be on a +# different tag than a local run. The "Pull Conductor OSS image" CI step prints the tag in use. services: conductor-server: From f6ca46c69d71b9ee73eba20eda5586843b66ffb4 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 12:18:48 -0600 Subject: [PATCH 06/14] test(oss): run tests that only failed on OSS because of the tests themselves Four OSS-gated integration tests failed because of the tests, not the server, so they now run against both OSS and Orkes: - testUpdateByRefNameSync completed only there_is_no_worker tasks, so nothing completed the workflow's first task (x_test_worker_0) on a server without workers. Complete every SIMPLE task, as testUpdateByRefName already does. - testSearchTasks and testPaginatedSearchTasks queried workflowId, which has no column in OSS's Postgres task_index. Query workflowType instead. - SchedulerClientTests.testMethods asserted that execution search returned something, which passed on Orkes only because of the shared cluster's history. A new testSearchExecutions fires its own schedule every second and waits for search to find that schedule's executions. Tag calls move to testSchedulerTags, gated because OSS has no schedule tags endpoint. Remove TestUtil.tolerateNotFound: the 500-for-not-found it accepted was fixed in OSS v3.32.2 (conductor-oss/conductor#1571), so cleanup goes back to the plain 404 check. Link testIdempotency's gate to conductor-oss/conductor#1527, reword the workflow-tags reason, and add CONTRIBUTING guidance to check a test's Orkes-only dependencies before gating it. Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTING.md | 16 ++++--- .../client/http/EventClientTests.java | 7 ++- .../client/http/MetadataClientTests.java | 14 +++--- .../client/http/SchedulerClientTests.java | 44 +++++++++++++++---- .../client/http/TaskClientTests.java | 16 +++---- .../client/http/WorkflowStateUpdateTests.java | 2 +- .../orkes/conductor/client/util/TestUtil.java | 23 ---------- 7 files changed, 63 insertions(+), 59 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32bcdefcd..47a50f2b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,12 +57,16 @@ JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home ./scripts/ Tests annotated `@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss")` skip themselves against plain OSS because they exercise Orkes-managed-only features (e.g. the Service Registry, Authorization, Prompts/Integrations, Environment Variables, and -Secrets APIs, plus a handful of task/workflow endpoints OSS doesn't implement or that hit -known Postgres-persistence bugs). Each annotation's `disabledReason` documents the specific, -empirically-confirmed gap — treat those as the source of truth rather than a list here, since -they can drift as OSS gains features. If you add or remove that annotation, re-verify against -a freshly-pulled image first: a test that fails against a stale local image may pass against -current OSS, and vice versa. +Secrets APIs, plus a handful of task/workflow endpoints OSS doesn't implement, and OSS gaps +with an open issue, such as start-workflow idempotency keys). Each annotation's +`disabledReason` documents the specific, empirically-confirmed gap — treat those as the source +of truth rather than a list here, since they can drift as OSS gains features. If you add or +remove that annotation, re-verify against a freshly-pulled image first: a test that fails +against a stale local image may pass against current OSS, and vice versa. + +Before gating a test, check that it doesn't depend on something only the shared Orkes cluster +provides, such as workers already polling a task type or prior execution history. Those tests +can usually be fixed to pass on both servers instead. Compile the maintained agent examples when changing their APIs or documentation: diff --git a/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java index 104e13ca5..c1e21d90b 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/EventClientTests.java @@ -24,7 +24,6 @@ import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; -import io.orkes.conductor.client.util.TestUtil; public class EventClientTests { private static final String EVENT_NAME = "test_sdk_java_event_name"; @@ -36,9 +35,9 @@ void testEventHandler() { try { eventClient.unregisterEventHandler(EVENT_NAME); } catch (ConductorClientException e) { - // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server - // we're running against actually reports it. - TestUtil.tolerateNotFound(e, "EventHandler with name"); + if (e.getStatus() != 404) { + throw e; + } } EventHandler eventHandler = getEventHandler(); eventClient.registerEventHandler(eventHandler); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java index 6754cfb15..ceaa22382 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java @@ -39,9 +39,9 @@ void taskDefinition() { try { metadataClient.unregisterTaskDef(Commons.TASK_NAME); } catch (ConductorClientException e) { - // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server - // we're running against actually reports it. - TestUtil.tolerateNotFound(e, "No such task definition"); + if (e.getStatus() != 404) { + throw e; + } } TaskDef taskDef = Commons.getTaskDef(); metadataClient.registerTaskDefs(List.of(taskDef)); @@ -55,9 +55,9 @@ void workflow() { try { metadataClient.unregisterWorkflowDef(Commons.WORKFLOW_NAME, Commons.WORKFLOW_VERSION); } catch (ConductorClientException e) { - // Best-effort cleanup: tolerate "doesn't exist" in whichever shape the server - // we're running against actually reports it. - TestUtil.tolerateNotFound(e, "No such workflow definition"); + if (e.getStatus() != 404) { + throw e; + } } metadataClient.registerTaskDefs(List.of(Commons.getTaskDef())); WorkflowDef workflowDef = WorkflowUtil.getWorkflowDef(); @@ -102,7 +102,7 @@ void tagTask() throws Exception { @Test @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "workflow tagging (/metadata/workflow/{name}/tags) is not implemented by plain OSS Conductor, confirmed empirically (the {version} path segment ends up matching the literal string \"tags\" instead, a server-side routing collision)") + disabledReason = "workflow tagging (/metadata/workflow/{name}/tags) is not implemented by OSS Conductor; the path falls through to DELETE /metadata/workflow/{name}/{version} with version=\"tags\", so other methods 405") void tagWorkflow() { TagObject tagObject = Commons.getTagObject(); try { diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java index 9bbc030a7..f1189e03e 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java @@ -12,6 +12,7 @@ */ package io.orkes.conductor.client.http; +import java.time.Duration; import java.util.List; import java.util.UUID; @@ -24,9 +25,11 @@ import io.orkes.conductor.client.model.SaveScheduleRequest; import io.orkes.conductor.client.model.TagObject; import io.orkes.conductor.client.model.WorkflowSchedule; +import io.orkes.conductor.client.model.WorkflowScheduleExecutionModel; import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; public class SchedulerClientTests { @@ -38,6 +41,7 @@ public class SchedulerClientTests { private static final String CRON_EXPRESSION_1 = "0 * * * * *"; private static final String CRON_EXPRESSION_2 = "0 0 */2 * * *"; // Every 2 hours private static final String CRON_EXPRESSION_3 = "0 0 0 * * *"; // Daily at midnight + private static final String CRON_EVERY_SECOND = "* * * * * *"; private final SchedulerClient schedulerClient = ClientTestUtil.getOrkesClients().getSchedulerClient(); @@ -52,10 +56,6 @@ void afterEach() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "GET /scheduler/search does not 404 on plain OSS Conductor, but confirmed empirically to " + - "always return zero results (even after polling for 30s) -- schedules aren't surfaced via search " + - "on plain OSS the way they are on Orkes Enterprise") void testMethods() { schedulerClient.deleteSchedule(SCHEDULE_1); Assertions.assertTrue(schedulerClient.getNextFewSchedules(CRON_EXPRESSION_1, 0L, 0L, 0).isEmpty()); @@ -64,11 +64,6 @@ void testMethods() { WorkflowSchedule workflowSchedule = schedulerClient.getSchedule(SCHEDULE_1); assertEquals(SCHEDULE_1, workflowSchedule.getName()); assertEquals(CRON_EXPRESSION_1, workflowSchedule.getCronExpression()); - Assertions.assertFalse(schedulerClient.search(0, 10, "ASC", "*", "").getResults().isEmpty()); - schedulerClient.setSchedulerTags(getTagObject(), SCHEDULE_1); - assertEquals(getTagObject(), schedulerClient.getSchedulerTags(SCHEDULE_1)); - schedulerClient.deleteSchedulerTags(getTagObject(), SCHEDULE_1); - assertEquals(0, schedulerClient.getSchedulerTags(SCHEDULE_1).size()); schedulerClient.pauseSchedule(SCHEDULE_1); workflowSchedule = schedulerClient.getSchedule(SCHEDULE_1); Assertions.assertTrue(workflowSchedule.isPaused()); @@ -78,6 +73,37 @@ void testMethods() { schedulerClient.deleteSchedule(SCHEDULE_1); } + @Test + @DisplayName("search should find the executions of a schedule once it has fired") + void testSearchExecutions() { + // search() covers executions, not schedules, so fire our own schedule every second rather + // than relying on whatever execution history the server already has. + schedulerClient.saveSchedule(new SaveScheduleRequest() + .name(SCHEDULE_1) + .cronExpression(CRON_EVERY_SECOND) + .startWorkflowRequest(Commons.getStartWorkflowRequest())); + + List executions = await() + .atMost(Duration.ofSeconds(60)) + .pollInterval(Duration.ofSeconds(2)) + .until(() -> schedulerClient.search(0, 10, "ASC", "*", "scheduleName IN (" + SCHEDULE_1 + ")") + .getResults(), results -> results != null && !results.isEmpty()); + schedulerClient.pauseSchedule(SCHEDULE_1); + + executions.forEach(execution -> assertEquals(SCHEDULE_1, execution.getScheduleName())); + } + + @Test + @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", + disabledReason = "schedule tagging (/scheduler/schedules/{name}/tags) is not implemented by OSS Conductor") + void testSchedulerTags() { + schedulerClient.saveSchedule(getSaveScheduleRequest()); + schedulerClient.setSchedulerTags(getTagObject(), SCHEDULE_1); + assertEquals(getTagObject(), schedulerClient.getSchedulerTags(SCHEDULE_1)); + schedulerClient.deleteSchedulerTags(getTagObject(), SCHEDULE_1); + assertEquals(0, schedulerClient.getSchedulerTags(SCHEDULE_1).size()); + } + @Test void testDebugMethods() { schedulerClient.pauseAllSchedules(); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java index bfc0bc0d0..fe8ef08bc 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java @@ -147,8 +147,6 @@ public void testUpdateByRefName() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the sync task-update endpoint (POST /tasks/{workflowId}/{taskRefName}/{status}/sync) never returns the updated workflow on plain OSS Conductor, confirmed empirically (caller times out waiting for terminal status)") public void testUpdateByRefNameSync() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); @@ -164,7 +162,9 @@ public void testUpdateByRefNameSync() { while (!workflow.getStatus().isTerminal() && count < maxLoop) { workflow = workflowClient.getWorkflow(workflowId, true); List runningTasks = workflow.getTasks().stream() - .filter(task -> !task.getStatus().isTerminal() && task.getTaskType().equals("there_is_no_worker")) + // Every SIMPLE task, not just the there_is_no_worker ones: nothing else completes the + // workflow's first task (x_test_worker_0), so the fork tasks would never be scheduled. + .filter(task -> !task.getStatus().isTerminal() && task.getWorkflowTask().getType().equals("SIMPLE")) .map(Task::getReferenceTaskName) .collect(Collectors.toList()); System.out.println("Running tasks: " + runningTasks); @@ -770,9 +770,9 @@ void testRequeuePendingTasksByTaskType() { // ==================== Search Tests ==================== + // These search on workflowType rather than workflowId: OSS Conductor's Postgres task_index has no + // workflow_id column, so a workflowId query fails there. @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "GET /tasks/search fails on plain OSS Conductor with a Postgres persistence layer, confirmed empirically (ERROR: column \"workflow_id\" does not exist)") void testSearchTasks() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); @@ -782,7 +782,7 @@ void testSearchTasks() { try { var result = TestUtil.retryUntil( - () -> taskClient.search("workflowId='" + workflowId + "'"), 30_000, 2_000); + () -> taskClient.search("workflowType='" + workflowName + "'"), 30_000, 2_000); assertNotNull(result); } finally { workflowClient.terminateWorkflow(workflowId, "cleanup"); @@ -809,8 +809,6 @@ void testSearchV2Tasks() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "GET /tasks/search fails on plain OSS Conductor with a Postgres persistence layer, confirmed empirically (ERROR: column \"workflow_id\" does not exist)") void testPaginatedSearchTasks() { StartWorkflowRequest request = new StartWorkflowRequest(); request.setName(workflowName); @@ -822,7 +820,7 @@ void testPaginatedSearchTasks() { Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); var result = taskClient.search( - 0, 10, "startTime:DESC", "*", "workflowId='" + workflowId + "'"); + 0, 10, "startTime:DESC", "*", "workflowType='" + workflowName + "'"); assertNotNull(result); } finally { workflowClient.terminateWorkflow(workflowId, "cleanup"); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java index 0faad3086..15a467e32 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java @@ -139,7 +139,7 @@ public void test() { @Test @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "workflow start idempotency keys are not honored by plain OSS Conductor, confirmed empirically (RETURN_EXISTING starts a brand-new run instead of returning the original workflowId)") + disabledReason = "OSS Conductor ignores start-workflow idempotency keys (RETURN_EXISTING starts a new run instead of returning the original workflowId); see conductor-oss/conductor#1527") public void testIdempotency() { StartWorkflowRequest startWorkflowRequest = new StartWorkflowRequest(); startWorkflowRequest.setName("sync_task_variable_updates"); diff --git a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java index bbb77c76d..65b13f72e 100644 --- a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java +++ b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java @@ -19,7 +19,6 @@ import java.util.concurrent.Callable; import java.util.concurrent.TimeoutException; -import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.config.ObjectMapperProvider; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; import com.netflix.conductor.common.run.Workflow; @@ -161,26 +160,4 @@ private static boolean isTerminalFailure(Workflow workflow) { return workflow.getStatus() == Workflow.WorkflowStatus.FAILED || workflow.getStatus() == Workflow.WorkflowStatus.TERMINATED; } - - /** - * Tolerates a caught exception that represents "resource doesn't exist", in either shape a - * Conductor server reports it in: a proper 404, or -- on plain OSS Conductor, for the - * endpoints where this has been empirically confirmed -- a 500 whose message contains - * {@code ossMessageSubstring}. Anything else is rethrown, since it isn't the "doesn't exist" - * case this is meant to tolerate. - * - *

Both shapes are accepted regardless of {@code CONDUCTOR_SERVER_TYPE}. Keying off that - * variable would break two ways: {@code run-integration-oss.sh --include-gated} runs against - * OSS with it deliberately unset, and OSS returning a correct 404 for one of these endpoints - * should not start failing the suite. - */ - public static void tolerateNotFound(ConductorClientException e, String ossMessageSubstring) { - if (e.getStatus() == 404) { - return; - } - if (e.getStatus() == 500 && e.getMessage() != null && e.getMessage().contains(ossMessageSubstring)) { - return; - } - throw e; - } } From c19f0bb2ccf5ee6483f4d852b58ebbfe3c9ebde7 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Thu, 19 Nov 2026 12:18:48 -0600 Subject: [PATCH 07/14] chore(scripts): save OSS container logs to a file instead of dumping them to the console On a failed run, write the conductor-server logs to tests/build/oss-conductor-server.log and print the exit code and the file's path, rather than printing the whole log. CI is unaffected: the integration-tests-oss job runs its own steps and still prints the logs. Co-Authored-By: Claude Opus 5.5 --- scripts/run-integration-oss.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/run-integration-oss.sh b/scripts/run-integration-oss.sh index 8b624b1d2..445a5d18b 100755 --- a/scripts/run-integration-oss.sh +++ b/scripts/run-integration-oss.sh @@ -59,11 +59,14 @@ cd "${REPO_ROOT}" compose() { docker compose -f "${COMPOSE_FILE}" "$@"; } +LOG_FILE="${REPO_ROOT}/tests/build/oss-conductor-server.log" + cleanup() { local status=$? if [[ "${status}" -ne 0 ]]; then - echo "Dumping conductor-server logs (exit ${status})..." >&2 - compose logs conductor-server || true + mkdir -p "$(dirname "${LOG_FILE}")" + compose logs --no-color conductor-server > "${LOG_FILE}" 2>&1 || true + echo "Tests run exited with code ${status}, container logs saved to ${LOG_FILE}" >&2 fi if [[ "${KEEP_UP}" == "1" ]]; then echo "--keep-up set: leaving the OSS stack running. Tear down with:" From ae3cd107e8d6b6e8be04ae6c6b22c979d1d62dba Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 10:28:34 -0600 Subject: [PATCH 08/14] ci: move OSS integration tests to their own pull_request workflow integration-tests.yml is triggered by workflow_run. That runs PR code with the base repo's write-scoped token, attaches JUnit check runs to main's HEAD instead of the PR, and cannot run a new job from a PR without a temporary push trigger. Restore integration-tests.yml to main and add integration-tests-oss.yml on pull_request, push to main and workflow_dispatch, the same shape as the OSS jobs in the other SDK repos. Fork PRs get a read-only token, so the report falls back to annotations and the job summary for them. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/integration-tests-oss.yml | 127 ++++++++++++++++ .github/workflows/integration-tests.yml | 154 +------------------- CONTRIBUTING.md | 2 +- scripts/docker-compose-oss.yaml | 2 +- scripts/run-integration-oss.sh | 2 +- 5 files changed, 132 insertions(+), 155 deletions(-) create mode 100644 .github/workflows/integration-tests-oss.yml diff --git a/.github/workflows/integration-tests-oss.yml b/.github/workflows/integration-tests-oss.yml new file mode 100644 index 000000000..51a977117 --- /dev/null +++ b/.github/workflows/integration-tests-oss.yml @@ -0,0 +1,127 @@ +name: Java Client Integration Tests (OSS) + +# Runs the integration suite against a local, disposable Conductor OSS stack +# (scripts/docker-compose-oss.yaml) instead of the Orkes deployment that +# integration-tests.yml targets. Orkes-Enterprise-only tests skip themselves via +# @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss"). +# scripts/run-integration-oss.sh runs the same suite locally. +# +# This is a plain pull_request workflow, like the OSS jobs in the other SDK repos, +# rather than a job in integration-tests.yml: that file is triggered by workflow_run, +# which runs PR code with the base repo's write-scoped token. Here a fork PR gets a +# read-only token, and GITHUB_SHA is the PR's commit, so the test report lands on +# the PR. +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + inputs: + oss_conductor_version: + description: 'OSS Conductor image tag (falls back to the E2E_TEST_OSS_CONDUCTOR_VERSION org var, then to the default in scripts/docker-compose-oss.yaml on fork PRs)' + required: false + type: string + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + integration-tests-oss: + runs-on: ubuntu-latest + name: Integration Tests (OSS) + timeout-minutes: 30 + + permissions: + contents: read # minimal read access + checks: write # needed for the test report check run + + env: + CONDUCTOR_SERVER_URL: http://localhost:8080/api + CONDUCTOR_SERVER_TYPE: oss + IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} + + steps: + # OSS_CONDUCTOR_VERSION is resolved here rather than in the job `env` so + # that the two ways it can come back empty get different treatment: + # + # - Fork PR: GitHub withholds org/repo variables from pull_request runs + # on forks exactly as it withholds secrets, so vars.* is always "" for + # an outside contributor (observed in csharp-sdk#178). This job needs + # no secrets, only a tag, so leave the var unset and let the default + # baked into the `image:` line of scripts/docker-compose-oss.yaml + # apply. That is the same tag a plain local run of + # scripts/run-integration-oss.sh gets, and the one place it is + # written -- no second copy to drift out of sync here. + # - Anything else: the org variable is genuinely missing or its + # repository access policy no longer covers this repo. Fail loudly + # rather than silently drifting onto the default. + - name: Resolve OSS Conductor version + env: + REQUESTED_VERSION: ${{ inputs.oss_conductor_version || vars.E2E_TEST_OSS_CONDUCTOR_VERSION }} + run: | + if [ -n "$REQUESTED_VERSION" ]; then + echo "OSS_CONDUCTOR_VERSION=${REQUESTED_VERSION}" >> "$GITHUB_ENV" + elif [ "$IS_FORK_PR" = "true" ]; then + echo "::notice::Fork PR: org variables are withheld, falling back to the default tag in scripts/docker-compose-oss.yaml" + else + echo "::error::No Conductor OSS image tag resolved. Set the E2E_TEST_OSS_CONDUCTOR_VERSION organization variable (and ensure its repository access policy includes this repo), or pass the oss_conductor_version input via workflow_dispatch." + exit 1 + fi + + - name: Checkout + uses: actions/checkout@v6 + with: + # The build below runs PR code; don't leave the token in .git/config for it. + persist-credentials: false + + - name: Set up Zulu JDK 21 + uses: actions/setup-java@v5 + with: + distribution: "zulu" + java-version: "21" + + # `docker compose up` only pulls an image when it is missing locally. On a + # GitHub-hosted runner the VM is ephemeral and starts with no cached copy + # of this image, so `up` would pull anyway and this step is redundant + # today. It is here deliberately: it costs no extra network pull (`up` + # then finds the image locally), it separates "couldn't pull the image" + # from "the stack didn't come up" into two distinct red steps, and it is + # what keeps a mutable tag from going stale if this job ever moves to a + # self-hosted runner with a warm Docker daemon -- the same reason + # scripts/run-integration-oss.sh pulls. It also prints the tag actually in + # use, which for a fork PR comes from the compose file's default. + - name: Pull Conductor OSS image + run: | + echo "Using $(docker compose -f scripts/docker-compose-oss.yaml config --images | grep -m1 '^conductoross/conductor:')" + docker compose -f scripts/docker-compose-oss.yaml pull conductor-server + + - name: Start Conductor OSS stack + run: docker compose -f scripts/docker-compose-oss.yaml up -d + + - name: Wait for Conductor to be healthy + # Matches HEALTH_TIMEOUT in scripts/run-integration-oss.sh, and stays under the compose + # healthcheck's own ~200s budget. + run: timeout 180 bash -c 'until curl -sf http://localhost:8080/health; do sleep 5; done' + + - name: Run integration tests (OSS) + run: ./gradlew :tests:test -PIntegrationTests + + - name: Dump Conductor logs + if: failure() + run: docker compose -f scripts/docker-compose-oss.yaml logs conductor-server + + - name: Publish Test Report + if: always() + uses: mikepenz/action-junit-report@v6 + with: + report_paths: 'tests/build/test-results/test/TEST-*.xml' + # Distinct from integration-tests.yml's report and ci.yml's unit report. The action + # defaults every caller to 'JUnit Test Report', so they would overwrite each other. + check_name: OSS Integration Test Report + # A fork PR's token is read-only and cannot create a check run; report through + # annotations and the job summary instead. + annotate_only: ${{ env.IS_FORK_PR == 'true' }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 2d82efae7..9ffbd9081 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,26 +5,6 @@ on: workflows: ["Java Client Build"] types: - completed - workflow_dispatch: - inputs: - oss_conductor_version: - description: 'OSS Conductor image tag (falls back to the E2E_TEST_OSS_CONDUCTOR_VERSION org var, then to the default in scripts/docker-compose-oss.yaml on fork PRs)' - required: false - type: string - - # --------------------------------------------------------------------------- - # TEMPORARY -- REMOVE BEFORE MERGE. - # - # A workflow_run-triggered run always executes the copy of this file on the - # default branch, so the integration-tests-oss job below cannot be exercised - # from a pull request. push runs the branch's own copy, so this trigger is - # what lets the job actually run while it is being developed. - # - # Deleting this block is sufficient to revert; nothing else below depends on it. - # --------------------------------------------------------------------------- - push: - branches: - - e2e-against-conductor-with-local-script # allow this workflow to update the status of the PR that triggered it permissions: @@ -32,9 +12,7 @@ permissions: checks: write concurrency: - # head_branch is only set for workflow_run; fall back to the ref so runs from - # other triggers do not all collapse into one unnamed concurrency group. - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }} + group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }} cancel-in-progress: true jobs: @@ -66,11 +44,7 @@ jobs: if: always() with: report_paths: '**/build/test-results/test/TEST-*.xml' - # Distinct per suite: the action defaults to 'JUnit Test Report' for every caller, so - # this report, the OSS one below, and ci.yml's unit report all landed on a single - # check run and overwrote each other. - check_name: Integration Test Report - + - name: Update PR Status if: always() uses: actions/github-script@v8 @@ -86,128 +60,4 @@ jobs: description: 'Integration tests ${{ job.status }}' }); - # Runs against a throwaway Conductor OSS stack rather than the Orkes deployment the job above - # targets, so it needs no secrets and no `environment`. It is deliberately a sibling of that - # job, not a dependent: an OSS failure must not suppress the enterprise suite, or vice versa. - integration-tests-oss: - runs-on: ubuntu-latest - name: Integration Tests (OSS) - timeout-minutes: 30 - # The build-succeeded gate only makes sense for workflow_run, which is the only trigger that - # has a triggering run to inspect. Any other trigger is a direct request to run this suite. - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} - env: - CONDUCTOR_SERVER_URL: http://localhost:8080/api - CONDUCTOR_SERVER_TYPE: oss - - steps: - # OSS_CONDUCTOR_VERSION is resolved here rather than in the job `env` so - # that the two ways it can come back empty get different treatment: - # - # - Fork PR: GitHub withholds org/repo variables from pull_request runs - # on forks exactly as it withholds secrets, so vars.* is always "" for - # an outside contributor (observed in csharp-sdk#178). This job needs - # no secrets, only a tag, so leave the var unset and let the default - # baked into the `image:` line of scripts/docker-compose-oss.yaml - # apply. That is the same tag a plain local run of - # scripts/run-integration-oss.sh gets, and the one place it is - # written -- no second copy to drift out of sync here. Note that the - # workflow_run trigger above executes in the base repo's context and - # does get the org variable even for a fork PR; the fork branch here - # matters for the push/dispatch paths and for any future direct - # pull_request trigger. - # - Anything else: the org variable is genuinely missing or its - # repository access policy no longer covers this repo. Fail loudly - # rather than silently drifting onto the default. - - name: Resolve OSS Conductor version - env: - REQUESTED_VERSION: ${{ inputs.oss_conductor_version || vars.E2E_TEST_OSS_CONDUCTOR_VERSION }} - IS_FORK_PR: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_run' && github.event.workflow_run.head_repository.full_name != github.repository) }} - run: | - if [ -n "$REQUESTED_VERSION" ]; then - echo "OSS_CONDUCTOR_VERSION=${REQUESTED_VERSION}" >> "$GITHUB_ENV" - elif [ "$IS_FORK_PR" = "true" ]; then - echo "::notice::Fork PR: org variables are withheld, falling back to the default tag in scripts/docker-compose-oss.yaml" - else - echo "::error::No Conductor OSS image tag resolved. Set the E2E_TEST_OSS_CONDUCTOR_VERSION organization variable (and ensure its repository access policy includes this repo), or pass the oss_conductor_version input via workflow_dispatch." - exit 1 - fi - - - name: Checkout - uses: actions/checkout@v6 - with: - # workflow_run carries the triggering run's head; workflow_dispatch has neither, and - # falls back to the ref the dispatch was made against. - ref: ${{ github.event.workflow_run.head_sha || github.sha }} - repository: ${{ github.event.workflow_run.repository.full_name || github.repository }} - - - name: Set up Zulu JDK 21 - uses: actions/setup-java@v5 - with: - distribution: "zulu" - java-version: "21" - - # `docker compose up` only pulls an image when it is missing locally. On a - # GitHub-hosted runner the VM is ephemeral and starts with no cached copy - # of this image, so `up` would pull anyway and this step is redundant - # today. It is here deliberately: it costs no extra network pull (`up` - # then finds the image locally), it separates "couldn't pull the image" - # from "the stack didn't come up" into two distinct red steps, and it is - # what keeps a mutable tag from going stale if this job ever moves to a - # self-hosted runner with a warm Docker daemon -- the same reason - # scripts/run-integration-oss.sh pulls. It also prints the tag actually in - # use, which for a fork PR comes from the compose file's default. - - name: Pull Conductor OSS image - run: | - echo "Using $(docker compose -f scripts/docker-compose-oss.yaml config --images | grep -m1 '^conductoross/conductor:')" - docker compose -f scripts/docker-compose-oss.yaml pull conductor-server - - - name: Start Conductor OSS stack - run: docker compose -f scripts/docker-compose-oss.yaml up -d - - - name: Wait for Conductor to be healthy - # Matches HEALTH_TIMEOUT in scripts/run-integration-oss.sh, and stays under the compose - # healthcheck's own ~200s budget. - run: timeout 180 bash -c 'until curl -sf http://localhost:8080/health; do sleep 5; done' - - - name: Run integration tests (OSS) - id: integration_tests - continue-on-error: true - run: ./gradlew :tests:test -PIntegrationTests - - - name: Dump Conductor logs - if: failure() || steps.integration_tests.outcome == 'failure' - run: docker compose -f scripts/docker-compose-oss.yaml logs conductor-server - - - name: Publish Test Report - if: always() - uses: mikepenz/action-junit-report@v6 - with: - report_paths: 'tests/build/test-results/test/TEST-*.xml' - check_name: OSS Integration Test Report - - # Before Update PR Status, not after: the test step is continue-on-error, so job.status is - # still 'success' until this step's exit 1 flips it. - - name: Check Integration Tests Status - if: steps.integration_tests.outcome == 'failure' - run: | - echo "::error::Integration tests (OSS) failed. See the 'Run integration tests (OSS)' step above for the Gradle/test output, the 'Dump Conductor logs' step for server-side logs, and the 'Publish Test Report' step's JUnit summary for which test(s) failed." - exit 1 - - - name: Update PR Status - # Skipped on workflow_dispatch: there is no triggering run, so there is no PR head to - # report against and context.payload.workflow_run would be undefined. - if: ${{ always() && github.event_name == 'workflow_run' }} - uses: actions/github-script@v8 - with: - script: | - const { owner, repo } = context.repo; - const sha = context.payload.workflow_run.head_sha; - await github.rest.repos.createCommitStatus({ - owner, repo, sha, - state: '${{ job.status }}' === 'success' ? 'success' : 'failure', - context: 'Integration Tests (OSS)', - target_url: `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`, - description: 'OSS integration tests ${{ job.status }}' - }); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47a50f2b0..bd245b562 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Run the SDK test suite: The `tests` module also has an integration suite (`-PIntegrationTests`) that runs against a real Conductor server, separate from the unit suite above. `scripts/run-integration-oss.sh` -mirrors the `integration-tests-oss` job in `integration-tests.yml`: it starts a local Conductor OSS + +mirrors the `.github/workflows/integration-tests-oss.yml` workflow: it starts a local Conductor OSS + Postgres stack (defined in `scripts/docker-compose-oss.yaml`), waits for `/health`, runs the integration suite, and tears the stack down on exit. diff --git a/scripts/docker-compose-oss.yaml b/scripts/docker-compose-oss.yaml index 50d830718..65951609c 100644 --- a/scripts/docker-compose-oss.yaml +++ b/scripts/docker-compose-oss.yaml @@ -1,6 +1,6 @@ # Conductor OSS stack used to run the SDK integration tests against open-source Conductor. # Shared by scripts/run-integration-oss.sh and the integration-tests-oss job in -# .github/workflows/integration-tests.yml. +# .github/workflows/integration-tests-oss.yml. # # The `image:` default below is the SINGLE place the Conductor OSS image tag is written. # Everything that does not override OSS_CONDUCTOR_VERSION lands on it: a plain diff --git a/scripts/run-integration-oss.sh b/scripts/run-integration-oss.sh index 445a5d18b..7e084b990 100755 --- a/scripts/run-integration-oss.sh +++ b/scripts/run-integration-oss.sh @@ -2,7 +2,7 @@ # # Spin up a local Conductor OSS stack and run the `tests` module's # integration suite against it, mirroring the `integration-tests-oss` job in -# .github/workflows/integration-tests.yml. Orkes-Enterprise-only test +# .github/workflows/integration-tests-oss.yml. Orkes-Enterprise-only test # classes are annotated with # @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss") # so they skip themselves when it's set (see the individual test files for From 134fd6ce686bfeb73f46cde32fb1e44620696207 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 10:45:23 -0600 Subject: [PATCH 09/14] fix(sdk): keep TaskClient metrics listeners when a task runner shuts down TaskRunnerConfigurer.shutdown() detached the auto-wired MetricsCollector from the TaskClient it was given, and nothing attached it again. The configurer does not own that TaskClient. AnnotatedWorkerExecutor reuses it for the next runner, so TaskClient-level metrics stopped after shutdown() and startPolling(). Adding a worker had the same effect: startPolling() starts the new runner before it shuts the old one down. The dispatchers are TaskClient instance fields, so leaving the listener registered leaks nothing. Correct the unregisterListeners() javadoc, which described a static registry. Co-Authored-By: Claude Opus 5.5 --- .../automator/TaskRunnerConfigurer.java | 4 +- .../conductor/client/http/TaskClient.java | 5 +- .../executor/task/AnnotatedWorkerTests.java | 48 +++++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/conductor-client/src/main/java/com/netflix/conductor/client/automator/TaskRunnerConfigurer.java b/conductor-client/src/main/java/com/netflix/conductor/client/automator/TaskRunnerConfigurer.java index 030246917..1dfd9fb92 100644 --- a/conductor-client/src/main/java/com/netflix/conductor/client/automator/TaskRunnerConfigurer.java +++ b/conductor-client/src/main/java/com/netflix/conductor/client/automator/TaskRunnerConfigurer.java @@ -159,9 +159,11 @@ public void shutdown() { } } scheduledExecutorService.shutdown(); + // Only this configurer's own dispatcher. The TaskClient is the caller's and may outlive + // this configurer (AnnotatedWorkerExecutor reuses it for the next runner), so its + // listeners are left in place. if (metricsCollector != null) { ListenerRegister.unregister(metricsCollector, eventDispatcher); - taskClient.unregisterListeners(); } } diff --git a/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java b/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java index 6dfd78170..abd23d08f 100644 --- a/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java +++ b/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java @@ -170,8 +170,9 @@ public void registerTaskRunnerListener(TaskRunnerEventsListener listener) { /** * Detaches the auto-wired {@link MetricsCollector} (if any) from this - * client's dispatchers. Called during shutdown to release the entries from - * {@link ListenerRegister}'s static registry. + * client's dispatchers, after which this client emits no metrics events. + * The dispatchers belong to this instance, so this is not needed to free + * them; call it only to stop metrics on a client that stays in use. */ public void unregisterListeners() { if (metricsCollector != null) { diff --git a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java index 37c0b4c7c..f112e3824 100644 --- a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java +++ b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java @@ -25,7 +25,12 @@ import org.junit.jupiter.api.Test; import com.netflix.conductor.client.automator.TaskRunnerConfigurer; +import com.netflix.conductor.client.events.taskrunner.TaskAckFailure; +import com.netflix.conductor.client.http.ConductorClient; +import com.netflix.conductor.client.http.ConductorClientRequest; +import com.netflix.conductor.client.http.ConductorClientResponse; import com.netflix.conductor.client.http.TaskClient; +import com.netflix.conductor.client.metrics.MetricsCollector; import com.netflix.conductor.client.worker.Worker; import com.netflix.conductor.common.metadata.tasks.Task; import com.netflix.conductor.sdk.workflow.executor.task.workers1.CarWorker1; @@ -37,9 +42,16 @@ import com.netflix.conductor.sdk.workflow.task.WorkerTask; import com.netflix.conductor.sdk.workflow.task.WorkflowInstanceIdInputParam; +import com.fasterxml.jackson.core.type.TypeReference; + import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; public class AnnotatedWorkerTests { private void testAnnotatedWorkersExecutor(Consumer test) { @@ -162,6 +174,42 @@ void startPollingRestartsAfterShutdown() { executor.shutdown(); } + @Test + @DisplayName("TaskClient metrics should keep flowing after a restart and after adding a worker") + @SuppressWarnings("unchecked") + void taskClientMetricsSurviveRunnerReplacement() { + var collector = mock(MetricsCollector.class); + var conductorClient = mock(ConductorClient.class); + when(conductorClient.getMetricsCollector()).thenReturn(collector); + // Polls get no tasks; acks are declined, so TaskClient publishes a TaskAckFailure to its + // auto-wired collector -- the listener a TaskRunnerConfigurer shutdown used to remove. + when(conductorClient.execute(any(ConductorClientRequest.class), any(TypeReference.class))) + .thenAnswer(invocation -> { + ConductorClientRequest request = invocation.getArgument(0); + Object data = request.getPath().endsWith("/ack") ? Boolean.FALSE : List.of(); + return new ConductorClientResponse<>(200, Map.of(), data); + }); + + var taskClient = new TaskClient(conductorClient); + var executor = new AnnotatedWorkerExecutor(taskClient); + executor.addBean(new MultipleInputParams()); + executor.startPolling(); + + executor.shutdown(); + executor.startPolling(); + taskClient.ack("multiple_input_params", "after-restart", "worker"); + verify(collector, timeout(5000)).consume(argThat((TaskAckFailure e) -> "after-restart".equals(e.getTaskId()))); + + // Builds the new runner before shutting the old one down, which is the order that + // detached the listeners out from under the live runner. + executor.addBean(new AnotherAnnotationInput()); + executor.startPolling(); + taskClient.ack("multiple_input_params", "after-add", "worker"); + verify(collector, timeout(5000)).consume(argThat((TaskAckFailure e) -> "after-add".equals(e.getTaskId()))); + + executor.shutdown(); + } + @Test @DisplayName("it should handle null values when InputParam is a List") void nullListAsInputParam() throws NoSuchMethodException { From d80268c1a5058e6df288a470ce4c38b0255fbc58 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 11:31:10 -0600 Subject: [PATCH 10/14] fix(compose): healthcheck Conductor with wget or curl Conductor images up to 3.34.0-rc2 are Debian-based and ship curl but not wget. From 3.34.0-rc3 they are Alpine-based and ship busybox wget but not curl. The OSS integration stack checked with curl only, so it would report unhealthy once the tag moves past rc2. hello-world checked with wget only, so it failed on an older cached `latest`. Try wget, then curl, in both. Co-Authored-By: Claude Opus 5.5 --- examples/basics/hello-world/docker-compose.yml | 10 +++++----- scripts/docker-compose-oss.yaml | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/basics/hello-world/docker-compose.yml b/examples/basics/hello-world/docker-compose.yml index 1a2f82c31..2b92c8f73 100644 --- a/examples/basics/hello-world/docker-compose.yml +++ b/examples/basics/hello-world/docker-compose.yml @@ -1,16 +1,16 @@ services: conductor: image: conductoross/conductor:latest - # Always re-pull so a stale local `latest` can't outlive the healthcheck - # below: images before 3.34.0 ship curl but not wget. + # Always re-pull so a stale local `latest` doesn't run an older release. pull_policy: always ports: - "${CONDUCTOR_PORT:-8080}:8080" - "${CONDUCTOR_UI_PORT:-1234}:5000" healthcheck: - # 127.0.0.1, not localhost: busybox wget tries ::1 first and does not - # fall back to the IPv4-bound server. - test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/health"] + # Images up to 3.34.0-rc2 ship curl but not wget; from rc3 on they ship + # busybox wget but not curl. Try both. 127.0.0.1 for wget: busybox wget + # tries ::1 first and does not fall back to the IPv4-bound server. + test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8080/health || curl -sf http://localhost:8080/health"] interval: 5s timeout: 5s retries: 12 diff --git a/scripts/docker-compose-oss.yaml b/scripts/docker-compose-oss.yaml index 65951609c..2a62db79e 100644 --- a/scripts/docker-compose-oss.yaml +++ b/scripts/docker-compose-oss.yaml @@ -20,7 +20,10 @@ services: ports: - "8080:8080" healthcheck: - test: ["CMD", "curl", "-I", "-XGET", "http://localhost:8080/health"] + # Images up to 3.34.0-rc2 ship curl but not wget; from rc3 on they ship busybox wget but not + # curl. Try both so the status is right on any tag. 127.0.0.1 for wget: busybox wget tries + # ::1 first and does not fall back to the IPv4-bound server. + test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8080/health || curl -sf http://localhost:8080/health"] interval: 10s timeout: 10s retries: 20 From ab244d17016e03dae37815f6c01e5223b9250690 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 11:54:33 -0600 Subject: [PATCH 11/14] test(oss): gate Orkes-only tests with @DisabledOnOss 26 tests repeated @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", ...). Replace them with @DisabledOnOss(""), so the variable name and value are in one place. A composed @DisabledIfEnvironmentVariable cannot pass a per-use reason through, so DisabledOnOssCondition evaluates it. Every reason is kept as it was. The signal/sync reason that TaskClientTests repeated 9 times is now one constant. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/integration-tests-oss.yml | 2 +- CONTRIBUTING.md | 7 ++-- scripts/run-integration-oss.sh | 5 ++- .../client/ServiceRegistryClientTest.java | 5 ++- .../conductor/client/WorkflowRetryTest.java | 5 ++- .../client/http/AuthorizationClientTests.java | 5 ++- .../client/http/EnvironmentClientTests.java | 20 +++++------ .../client/http/MetadataClientTests.java | 8 ++--- .../client/http/PromptClientTests.java | 7 ++-- .../client/http/SchedulerClientTests.java | 5 ++- .../client/http/SchemaClientTests.java | 5 ++- .../client/http/SecretClientTests.java | 5 ++- .../http/ServiceRegistryClientTests.java | 5 ++- .../client/http/TaskClientTests.java | 34 +++++++----------- .../client/http/TokenClientTest.java | 5 ++- .../client/http/WorkflowClientTests.java | 8 ++--- .../client/http/WorkflowStateUpdateTests.java | 8 ++--- .../conductor/client/util/DisabledOnOss.java | 36 +++++++++++++++++++ .../client/util/DisabledOnOssCondition.java | 36 +++++++++++++++++++ 19 files changed, 129 insertions(+), 82 deletions(-) create mode 100644 tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOss.java create mode 100644 tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java diff --git a/.github/workflows/integration-tests-oss.yml b/.github/workflows/integration-tests-oss.yml index 51a977117..412b8a0ed 100644 --- a/.github/workflows/integration-tests-oss.yml +++ b/.github/workflows/integration-tests-oss.yml @@ -3,7 +3,7 @@ name: Java Client Integration Tests (OSS) # Runs the integration suite against a local, disposable Conductor OSS stack # (scripts/docker-compose-oss.yaml) instead of the Orkes deployment that # integration-tests.yml targets. Orkes-Enterprise-only tests skip themselves via -# @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss"). +# @DisabledOnOss, which checks CONDUCTOR_SERVER_TYPE=oss. # scripts/run-integration-oss.sh runs the same suite locally. # # This is a plain pull_request workflow, like the OSS jobs in the other SDK repos, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd245b562..d5105f61e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,12 +54,11 @@ set `JAVA_HOME` explicitly to match CI: JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home ./scripts/run-integration-oss.sh ``` -Tests annotated `@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = -"oss")` skip themselves against plain OSS because they exercise Orkes-managed-only features -(e.g. the Service Registry, Authorization, Prompts/Integrations, Environment Variables, and +Tests annotated `@DisabledOnOss("")` skip themselves when `CONDUCTOR_SERVER_TYPE=oss`, +because they exercise Orkes-managed-only features that plain OSS lacks (e.g. the Service Registry, Authorization, Prompts/Integrations, Environment Variables, and Secrets APIs, plus a handful of task/workflow endpoints OSS doesn't implement, and OSS gaps with an open issue, such as start-workflow idempotency keys). Each annotation's -`disabledReason` documents the specific, empirically-confirmed gap — treat those as the source +reason documents the specific, empirically-confirmed gap — treat those as the source of truth rather than a list here, since they can drift as OSS gains features. If you add or remove that annotation, re-verify against a freshly-pulled image first: a test that fails against a stale local image may pass against current OSS, and vice versa. diff --git a/scripts/run-integration-oss.sh b/scripts/run-integration-oss.sh index 7e084b990..f1c26fab2 100755 --- a/scripts/run-integration-oss.sh +++ b/scripts/run-integration-oss.sh @@ -3,9 +3,8 @@ # Spin up a local Conductor OSS stack and run the `tests` module's # integration suite against it, mirroring the `integration-tests-oss` job in # .github/workflows/integration-tests-oss.yml. Orkes-Enterprise-only test -# classes are annotated with -# @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss") -# so they skip themselves when it's set (see the individual test files for +# classes are annotated with @DisabledOnOss, so they skip themselves when +# CONDUCTOR_SERVER_TYPE=oss is set (see the individual test files for # the empirically-confirmed gaps). # # The stack (Conductor OSS + Postgres) is defined in diff --git a/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java b/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java index 64fc95d0f..e4bf2f9e9 100644 --- a/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/ServiceRegistryClientTest.java @@ -19,20 +19,19 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.model.OrkesCircuitBreakerConfig; import com.netflix.conductor.common.model.ServiceMethod; import com.netflix.conductor.common.model.ServiceRegistry; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") +@DisabledOnOss("the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") public class ServiceRegistryClientTest { private static final String PROTO_FILENAME = "compiled.bin"; diff --git a/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java b/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java index 739367075..d5869a23e 100644 --- a/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/WorkflowRetryTest.java @@ -18,7 +18,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.metadata.tasks.TaskDef; import com.netflix.conductor.common.metadata.tasks.TaskResult; @@ -32,13 +31,13 @@ import io.orkes.conductor.client.http.OrkesWorkflowClient; import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.DisabledOnOss; import com.google.common.util.concurrent.Uninterruptibles; import lombok.extern.slf4j.Slf4j; @Slf4j -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "workflowClient.uploadCompletedWorkflows() (/workflow/document-store/upload) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/document-store/upload')") +@DisabledOnOss("workflowClient.uploadCompletedWorkflows() (/workflow/document-store/upload) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/document-store/upload')") public class WorkflowRetryTest { private final OrkesMetadataClient metadataClient; private final OrkesWorkflowClient workflowClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java index fa896a45d..6a3bd1aa7 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/AuthorizationClientTests.java @@ -25,7 +25,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; @@ -49,9 +48,9 @@ import io.orkes.conductor.client.model.UpsertUserRequest; import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the Authorization APIs (applications/users/groups/roles/permissions) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/applications|users|groups|...')") +@DisabledOnOss("the Authorization APIs (applications/users/groups/roles/permissions) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/applications|users|groups|...')") public class AuthorizationClientTests { private static AuthorizationClient authorizationClient; private static String applicationId; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java index d1de9535b..f581760e0 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/EnvironmentClientTests.java @@ -12,21 +12,21 @@ */ package io.orkes.conductor.client.http; -import io.orkes.conductor.client.EnvironmentClient; -import io.orkes.conductor.client.model.Tag; -import io.orkes.conductor.client.model.environment.EnvironmentVariable; -import io.orkes.conductor.client.util.ClientTestUtil; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; -import java.util.List; -import java.util.Optional; -import java.util.UUID; +import io.orkes.conductor.client.EnvironmentClient; +import io.orkes.conductor.client.model.Tag; +import io.orkes.conductor.client.model.environment.EnvironmentVariable; +import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "environment variable writes are not supported by plain OSS Conductor, confirmed empirically: OSS added read-only GET /environment in 3.32.0-rc.9 but PUT /environment/{key} still 405s ('Request method 'PUT' is not supported')") +@DisabledOnOss("environment variable writes are not supported by plain OSS Conductor, confirmed empirically: OSS added read-only GET /environment in 3.32.0-rc.9 but PUT /environment/{key} still 405s ('Request method 'PUT' is not supported')") public class EnvironmentClientTests { private static EnvironmentClient envClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java index ceaa22382..9b4052725 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.tasks.TaskDef; @@ -25,6 +24,7 @@ import io.orkes.conductor.client.model.TagObject; import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.DisabledOnOss; import io.orkes.conductor.client.util.TestUtil; import io.orkes.conductor.client.util.WorkflowUtil; @@ -74,8 +74,7 @@ void workflow() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "task tagging (/metadata/task/{name}/tags) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/metadata/task/{name}/tags')") + @DisabledOnOss("task tagging (/metadata/task/{name}/tags) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/metadata/task/{name}/tags')") void tagTask() throws Exception { metadataClient.registerTaskDefs(List.of(Commons.getTaskDef())); try { @@ -101,8 +100,7 @@ void tagTask() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "workflow tagging (/metadata/workflow/{name}/tags) is not implemented by OSS Conductor; the path falls through to DELETE /metadata/workflow/{name}/{version} with version=\"tags\", so other methods 405") + @DisabledOnOss("workflow tagging (/metadata/workflow/{name}/tags) is not implemented by OSS Conductor; the path falls through to DELETE /metadata/workflow/{name}/{version} with version=\"tags\", so other methods 405") void tagWorkflow() { TagObject tagObject = Commons.getTagObject(); try { diff --git a/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java index 2ce260590..7162691d3 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/PromptClientTests.java @@ -16,11 +16,11 @@ import java.util.List; import java.util.Map; +import org.conductoross.conductor.client.model.ai.PromptTemplate; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; @@ -30,11 +30,10 @@ import io.orkes.conductor.client.model.integration.Category; import io.orkes.conductor.client.model.integration.IntegrationApiUpdate; import io.orkes.conductor.client.model.integration.IntegrationUpdate; -import org.conductoross.conductor.client.model.ai.PromptTemplate; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the Prompts and Integrations APIs (/prompts, /integrations) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/prompts|integrations/...')") +@DisabledOnOss("the Prompts and Integrations APIs (/prompts, /integrations) are not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/prompts|integrations/...')") public class PromptClientTests { private static final String PROMPT_NAME = "test-sdk-java-prompt"; private static final String PROMPT_DESCRIPTION = "Test prompt for Java SDK"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java index f1189e03e..1fc0c83ef 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SchedulerClientTests.java @@ -17,7 +17,6 @@ import java.util.UUID; import org.junit.jupiter.api.*; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.model.BulkResponse; @@ -28,6 +27,7 @@ import io.orkes.conductor.client.model.WorkflowScheduleExecutionModel; import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.DisabledOnOss; import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -94,8 +94,7 @@ void testSearchExecutions() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "schedule tagging (/scheduler/schedules/{name}/tags) is not implemented by OSS Conductor") + @DisabledOnOss("schedule tagging (/scheduler/schedules/{name}/tags) is not implemented by OSS Conductor") void testSchedulerTags() { schedulerClient.saveSchedule(getSaveScheduleRequest()); schedulerClient.setSchedulerTags(getTagObject(), SCHEDULE_1); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java index 8dd145160..b116d5258 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SchemaClientTests.java @@ -17,16 +17,15 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.SchemaDef; import io.orkes.conductor.client.SchemaClient; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the Schema API (/schema) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/schema')") +@DisabledOnOss("the Schema API (/schema) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/schema')") public class SchemaClientTests { private static final String SCHEMA_NAME = "test-sdk-java-schema"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java index 33ce31ee7..c316ab347 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/SecretClientTests.java @@ -16,17 +16,16 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import io.orkes.conductor.client.SecretClient; import io.orkes.conductor.client.model.TagObject; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "secret writes are not supported by plain OSS Conductor, confirmed empirically: its env-var-backed secrets DAO is read-only, so putSecret() 501s ('env-backed secrets are read-only')") +@DisabledOnOss("secret writes are not supported by plain OSS Conductor, confirmed empirically: its env-var-backed secrets DAO is read-only, so putSecret() 501s ('env-backed secrets are read-only')") public class SecretClientTests { private final String SECRET_NAME = "test-sdk-java-secret_name"; private final String SECRET_KEY = "test-sdk-java-secret_key"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java index a09ba6c85..575939e26 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/ServiceRegistryClientTests.java @@ -18,7 +18,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.model.CircuitBreakerTransitionResponse; @@ -28,13 +27,13 @@ import io.orkes.conductor.client.ServiceRegistryClient; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; import lombok.SneakyThrows; import static org.junit.jupiter.api.Assertions.assertNull; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") +@DisabledOnOss("the Service Registry API (/registry/service) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/registry/service')") public class ServiceRegistryClientTests { private static final String SERVICE_NAME = "test-sdk-java-service"; private static final String SERVICE_URI = "localhost:50051"; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java index fe8ef08bc..009f05d1e 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.testcontainers.shaded.com.google.common.util.concurrent.Uninterruptibles; @@ -48,6 +47,7 @@ import com.netflix.conductor.sdk.workflow.executor.WorkflowExecutor; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; import io.orkes.conductor.client.util.TestUtil; import com.fasterxml.jackson.databind.ObjectMapper; @@ -55,6 +55,8 @@ import static org.junit.jupiter.api.Assertions.*; public class TaskClientTests { + private static final String SIGNAL_SYNC_NOT_ON_OSS = + "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically"; private static final String COMPLEX_WF_NAME = "complex_wf_signal_test"; private static final String SUB_WF_1_NAME = "complex_wf_signal_test_subworkflow_1"; @@ -335,8 +337,7 @@ private void completeWorkflow(String workflowId) throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testSyncTargetWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.TARGET_WORKFLOW); @@ -351,8 +352,7 @@ void testSyncTargetWorkflow() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testSyncBlockingWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_WORKFLOW); @@ -367,8 +367,7 @@ void testSyncBlockingWorkflow() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testSyncBlockingTask() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK); @@ -383,8 +382,7 @@ void testSyncBlockingTask() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "BLOCKING_TASK_LIST is not a value of the server-side WorkflowSignalReturnStrategy enum in any OSS Conductor release, so OSS rejects the returnStrategy parameter outright, on top of not implementing the signal/sync API the other BLOCKING_* tests are skipped for") + @DisabledOnOss("BLOCKING_TASK_LIST is not a value of the server-side WorkflowSignalReturnStrategy enum in any OSS Conductor release, so OSS rejects the returnStrategy parameter outright, on top of not implementing the signal/sync API the other BLOCKING_* tests are skipped for") void testSyncBlockingTaskList() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK_LIST); @@ -402,8 +400,7 @@ void testSyncBlockingTaskList() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testSyncBlockingTaskInput() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.BLOCKING_TASK_INPUT); @@ -423,8 +420,7 @@ void testSyncBlockingTaskInput() throws Exception { @Test @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", disabledReason = "target server has no region replication configured") - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testDurableTargetWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.TARGET_WORKFLOW); @@ -441,8 +437,7 @@ void testDurableTargetWorkflow() throws Exception { @Test @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", disabledReason = "target server has no region replication configured") - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testDurableBlockingWorkflow() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.BLOCKING_WORKFLOW); @@ -457,8 +452,7 @@ void testDurableBlockingWorkflow() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testDurableBlockingTask() throws Exception { String workflowId = startComplexWorkflow(Consistency.DURABLE, ReturnStrategy.BLOCKING_TASK); @@ -475,8 +469,7 @@ void testDurableBlockingTask() throws Exception { @Test @EnabledIfEnvironmentVariable(named = REGION_DURABLE_ENABLED, matches = "true", disabledReason = "target server has no region replication configured") - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testDurableBlockingTaskInput() throws Exception { String workflowId = startComplexWorkflow(Consistency.REGION_DURABLE, ReturnStrategy.BLOCKING_TASK_INPUT); @@ -491,8 +484,7 @@ void testDurableBlockingTaskInput() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the SYNCHRONOUS/REGION_DURABLE consistency + BLOCKING_* return-strategy signal API (POST /tasks/{workflowId}/{status}/signal/sync) is not implemented by plain OSS Conductor, confirmed empirically") + @DisabledOnOss(SIGNAL_SYNC_NOT_ON_OSS) void testDefaultReturnStrategy() throws Exception { String workflowId = startComplexWorkflow(Consistency.SYNCHRONOUS, ReturnStrategy.TARGET_WORKFLOW); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java b/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java index 7f6ed98db..7b3df523c 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TokenClientTest.java @@ -16,14 +16,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import io.orkes.conductor.client.model.GenerateTokenRequest; import io.orkes.conductor.client.model.TokenResponse; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; -@DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "the auth Token API (/token) is not implemented by plain OSS Conductor (which has no authentication layer), confirmed empirically (404 'No static resource api/token')") +@DisabledOnOss("the auth Token API (/token) is not implemented by plain OSS Conductor (which has no authentication layer), confirmed empirically (404 'No static resource api/token')") public class TokenClientTest { public static OrkesTokenClient tokenClient; diff --git a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java index c4c5e8e13..85f36dbdc 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowClientTests.java @@ -22,7 +22,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.common.metadata.tasks.TaskDef; import com.netflix.conductor.common.metadata.tasks.TaskResult; @@ -42,6 +41,7 @@ import io.orkes.conductor.client.util.ClientTestUtil; import io.orkes.conductor.client.util.Commons; +import io.orkes.conductor.client.util.DisabledOnOss; import io.orkes.conductor.client.util.TestUtil; import com.google.common.util.concurrent.Uninterruptibles; @@ -103,8 +103,7 @@ public void startWorkflow() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "batch correlation-id search (POST /workflow/correlated/batch) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/correlated/batch')") + @DisabledOnOss("batch correlation-id search (POST /workflow/correlated/batch) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/correlated/batch')") public void testSearchByCorrelationIds() { List correlationIds = new ArrayList<>(); Set workflowNames = new HashSet<>(); @@ -191,8 +190,7 @@ public void testSkipTaskFromWorkflow() throws Exception { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "POST /workflow/{workflowId}/variables is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/variables')") + @DisabledOnOss("POST /workflow/{workflowId}/variables is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/variables')") public void testUpdateVariables() { ConductorWorkflow workflow = new ConductorWorkflow<>(workflowExecutor); workflow.add(new SimpleTask("simple_task", "simple_task_ref")); diff --git a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java index 15a467e32..c8dfc1dbf 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/WorkflowStateUpdateTests.java @@ -22,7 +22,6 @@ import org.conductoross.conductor.common.model.WorkflowRun; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import com.netflix.conductor.client.exception.ConductorClientException; import com.netflix.conductor.common.metadata.tasks.Task; @@ -36,6 +35,7 @@ import io.orkes.conductor.client.model.WorkflowStateUpdate; import io.orkes.conductor.client.util.ClientTestUtil; +import io.orkes.conductor.client.util.DisabledOnOss; import lombok.SneakyThrows; @@ -92,8 +92,7 @@ public String startWorkflow() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "POST /workflow/{workflowId}/state (updateWorkflow) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/state')") + @DisabledOnOss("POST /workflow/{workflowId}/state (updateWorkflow) is not implemented by plain OSS Conductor, confirmed empirically (404 'No static resource api/workflow/{id}/state')") public void test() { String workflowId = startWorkflow(); System.out.println(workflowId); @@ -138,8 +137,7 @@ public void test() { } @Test - @DisabledIfEnvironmentVariable(named = "CONDUCTOR_SERVER_TYPE", matches = "oss", - disabledReason = "OSS Conductor ignores start-workflow idempotency keys (RETURN_EXISTING starts a new run instead of returning the original workflowId); see conductor-oss/conductor#1527") + @DisabledOnOss("OSS Conductor ignores start-workflow idempotency keys (RETURN_EXISTING starts a new run instead of returning the original workflowId); see conductor-oss/conductor#1527") public void testIdempotency() { StartWorkflowRequest startWorkflowRequest = new StartWorkflowRequest(); startWorkflowRequest.setName("sync_task_variable_updates"); diff --git a/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOss.java b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOss.java new file mode 100644 index 000000000..d1decf8d9 --- /dev/null +++ b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOss.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 Conductor Authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.orkes.conductor.client.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * Skips the annotated test class or method when the suite runs against plain Conductor OSS, i.e. + * when {@code CONDUCTOR_SERVER_TYPE=oss}. For Orkes-only features that OSS does not implement. + * + *

Not a composed {@code @DisabledIfEnvironmentVariable}: a meta-annotation cannot pass a + * per-use reason through, and the reason is the record of each gap. + */ +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@ExtendWith(DisabledOnOssCondition.class) +public @interface DisabledOnOss { + + /** The specific, empirically-confirmed OSS gap, reported as the skip reason. */ + String value(); +} diff --git a/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java new file mode 100644 index 000000000..74314b561 --- /dev/null +++ b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 Conductor Authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package io.orkes.conductor.client.util; + +import org.junit.jupiter.api.extension.ConditionEvaluationResult; +import org.junit.jupiter.api.extension.ExecutionCondition; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.platform.commons.support.AnnotationSupport; + +/** Evaluates {@link DisabledOnOss}. */ +public final class DisabledOnOssCondition implements ExecutionCondition { + + /** Set by scripts/run-integration-oss.sh and the OSS CI workflow; unset for Orkes. */ + static final String SERVER_TYPE_ENV = "CONDUCTOR_SERVER_TYPE"; + + static final String OSS = "oss"; + + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + return AnnotationSupport.findAnnotation(context.getElement(), DisabledOnOss.class) + .filter(annotation -> OSS.equals(System.getenv(SERVER_TYPE_ENV))) + .map(annotation -> ConditionEvaluationResult.disabled( + SERVER_TYPE_ENV + "=" + OSS, annotation.value())) + .orElseGet(() -> ConditionEvaluationResult.enabled("not running against Conductor OSS")); + } +} From 26ab01b69527d15e4a56db859c4723f83422ee9c Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 12:50:06 -0600 Subject: [PATCH 12/14] chore(scripts): default the OSS integration stack to Conductor 3.34.0 The default applies to fork PRs and plain local runs of run-integration-oss.sh. 3.34.0 is the current release and is close to the 3.34.0-rc2 that CI runs through the E2E_TEST_OSS_CONDUCTOR_VERSION org variable. Co-Authored-By: Claude Opus 5.5 --- scripts/docker-compose-oss.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docker-compose-oss.yaml b/scripts/docker-compose-oss.yaml index 2a62db79e..48fc06988 100644 --- a/scripts/docker-compose-oss.yaml +++ b/scripts/docker-compose-oss.yaml @@ -14,7 +14,7 @@ services: conductor-server: - image: conductoross/conductor:${OSS_CONDUCTOR_VERSION:-3.32.3} + image: conductoross/conductor:${OSS_CONDUCTOR_VERSION:-3.34.0} environment: - CONFIG_PROP=config-postgres.properties ports: From ce963b92196bbe49a5368d0f7a338369ecab6e10 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 13:33:42 -0600 Subject: [PATCH 13/14] test(sdk): wait on recorded ack failures instead of verify(timeout, argThat) taskClientMetricsSurviveRunnerReplacement failed in CI with a ClassCastException. When the async TaskAckFailure had not arrived yet, Mockito's failure reporting ran the typed argThat lambda against the collector's other consume() calls, such as PollStarted. timeout() only retries on assertion errors, so the cast error ended the test. Record TaskAckFailure task ids in a queue from a stub on that overload alone, and wait on the queue. Co-Authored-By: Claude Opus 5.5 --- .../executor/task/AnnotatedWorkerTests.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java index f112e3824..a0c529199 100644 --- a/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java +++ b/conductor-client/src/test/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerTests.java @@ -19,6 +19,9 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import org.junit.jupiter.api.DisplayName; @@ -47,10 +50,8 @@ import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class AnnotatedWorkerTests { @@ -177,8 +178,13 @@ void startPollingRestartsAfterShutdown() { @Test @DisplayName("TaskClient metrics should keep flowing after a restart and after adding a worker") @SuppressWarnings("unchecked") - void taskClientMetricsSurviveRunnerReplacement() { + void taskClientMetricsSurviveRunnerReplacement() throws InterruptedException { var collector = mock(MetricsCollector.class); + // Delivery is asynchronous, so record ack failures and wait on them. Only this overload is + // stubbed: the collector also receives poll events through its other consume() overloads. + BlockingQueue ackFailures = new LinkedBlockingQueue<>(); + doAnswer(invocation -> ackFailures.add(invocation.getArgument(0).getTaskId())) + .when(collector).consume(any(TaskAckFailure.class)); var conductorClient = mock(ConductorClient.class); when(conductorClient.getMetricsCollector()).thenReturn(collector); // Polls get no tasks; acks are declined, so TaskClient publishes a TaskAckFailure to its @@ -198,14 +204,14 @@ void taskClientMetricsSurviveRunnerReplacement() { executor.shutdown(); executor.startPolling(); taskClient.ack("multiple_input_params", "after-restart", "worker"); - verify(collector, timeout(5000)).consume(argThat((TaskAckFailure e) -> "after-restart".equals(e.getTaskId()))); + assertEquals("after-restart", ackFailures.poll(5, TimeUnit.SECONDS)); // Builds the new runner before shutting the old one down, which is the order that // detached the listeners out from under the live runner. executor.addBean(new AnotherAnnotationInput()); executor.startPolling(); taskClient.ack("multiple_input_params", "after-add", "worker"); - verify(collector, timeout(5000)).consume(argThat((TaskAckFailure e) -> "after-add".equals(e.getTaskId()))); + assertEquals("after-add", ackFailures.poll(5, TimeUnit.SECONDS)); executor.shutdown(); } From e0479408ff4519fe93d6cd9dc914a3e722f662e4 Mon Sep 17 00:00:00 2001 From: Chris Hagglund Date: Mon, 23 Nov 2026 13:41:52 -0600 Subject: [PATCH 14/14] test: search tasks by workflowId on Orkes, by workflowType only on OSS f6ca46c69 moved testSearchTasks and testPaginatedSearchTasks to a workflowType query, because OSS's Postgres task_index has no workflow_id column. On the shared Orkes cluster that query covers every past run of the workflow, and the server timed out on it. Keep the workflowId query on Orkes. Add TestUtil.isOssServer(), which @DisabledOnOss now uses too. Co-Authored-By: Claude Opus 5.5 --- .../conductor/client/http/TaskClientTests.java | 15 +++++++++++---- .../client/util/DisabledOnOssCondition.java | 2 +- .../io/orkes/conductor/client/util/TestUtil.java | 5 +++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java index 009f05d1e..b453e0ed6 100644 --- a/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java +++ b/tests/src/test/java/io/orkes/conductor/client/http/TaskClientTests.java @@ -762,8 +762,15 @@ void testRequeuePendingTasksByTaskType() { // ==================== Search Tests ==================== - // These search on workflowType rather than workflowId: OSS Conductor's Postgres task_index has no - // workflow_id column, so a workflowId query fails there. + // OSS Conductor's Postgres task_index has no workflow_id column, so a workflowId query fails there. + // On the shared Orkes cluster a workflowType query covers every past run of this workflow and can + // time out, so only OSS searches by workflowType. + private String taskSearchQuery(String workflowId) { + return TestUtil.isOssServer() + ? "workflowType='" + workflowName + "'" + : "workflowId='" + workflowId + "'"; + } + @Test void testSearchTasks() { StartWorkflowRequest request = new StartWorkflowRequest(); @@ -774,7 +781,7 @@ void testSearchTasks() { try { var result = TestUtil.retryUntil( - () -> taskClient.search("workflowType='" + workflowName + "'"), 30_000, 2_000); + () -> taskClient.search(taskSearchQuery(workflowId)), 30_000, 2_000); assertNotNull(result); } finally { workflowClient.terminateWorkflow(workflowId, "cleanup"); @@ -812,7 +819,7 @@ void testPaginatedSearchTasks() { Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); var result = taskClient.search( - 0, 10, "startTime:DESC", "*", "workflowType='" + workflowName + "'"); + 0, 10, "startTime:DESC", "*", taskSearchQuery(workflowId)); assertNotNull(result); } finally { workflowClient.terminateWorkflow(workflowId, "cleanup"); diff --git a/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java index 74314b561..d3c74ae34 100644 --- a/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java +++ b/tests/src/test/java/io/orkes/conductor/client/util/DisabledOnOssCondition.java @@ -28,7 +28,7 @@ public final class DisabledOnOssCondition implements ExecutionCondition { @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { return AnnotationSupport.findAnnotation(context.getElement(), DisabledOnOss.class) - .filter(annotation -> OSS.equals(System.getenv(SERVER_TYPE_ENV))) + .filter(annotation -> TestUtil.isOssServer()) .map(annotation -> ConditionEvaluationResult.disabled( SERVER_TYPE_ENV + "=" + OSS, annotation.value())) .orElseGet(() -> ConditionEvaluationResult.enabled("not running against Conductor OSS")); diff --git a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java index 65b13f72e..d3378c035 100644 --- a/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java +++ b/tests/src/test/java/io/orkes/conductor/client/util/TestUtil.java @@ -156,6 +156,11 @@ public static T retryUntil(Callable call, long maxWaitTimeMs, long pollIn .until(call, result -> true); } + /** True when the suite runs against plain Conductor OSS, i.e. {@code CONDUCTOR_SERVER_TYPE=oss}. */ + public static boolean isOssServer() { + return DisabledOnOssCondition.OSS.equals(System.getenv(DisabledOnOssCondition.SERVER_TYPE_ENV)); + } + private static boolean isTerminalFailure(Workflow workflow) { return workflow.getStatus() == Workflow.WorkflowStatus.FAILED || workflow.getStatus() == Workflow.WorkflowStatus.TERMINATED;