Skip to content

[ci] Phase 0: fix the broken CI (hangs, macOS runner, Sonar, integration test) - #2647

Closed
DiegoTavares wants to merge 7 commits into
masterfrom
ci/phase-0-fixes
Closed

DiegoTavares wants to merge 7 commits into
masterfrom
ci/phase-0-fixes

Conversation

@DiegoTavares

@DiegoTavares DiegoTavares commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Related Issues

None filed. This PR is PR 1 of 5 in a stacked CI overhaul (Phase 0: fix what is broken). The later phases (a single pr.yml with change detection, master.yml, release as promotion, faster scripts and Dockerfiles) build on this branch.

Summarize your change.

An analysis of the last 1,000 workflow runs (16 Sep to 19 Nov) found the CI slow and red mainly because of a few broken things. This PR fixes them against the current workflows, without restructuring anything. One commit per item.

F1: rqd integration tests no longer hang

0 of 267 Rust pipeline runs finished green. windows-tests hung in rqd_integration_tests on 54 of 55 sampled runs and burned the 60-minute timeout. The Linux build job hung the same way on 27% of runs.

  • monitor_server_output only checked its deadline after reader.lines() returned a line, so a silent dummy-cuebot blocked forever. Child stdout/stderr are now read on threads and the monitor waits with recv_timeout. The server is killed and reaped on timeout.
  • openrqd's output (debug-level logs on stdout) went to a pipe nobody read, which can fill (Windows pipe buffers are small) and stall rqd, which then makes dummy-cuebot go silent. Both children's pipes are now drained.
  • New test test_monitor_times_out_on_silent_server.
  • The Rust jobs run cargo nextest. rust/.config/nextest.toml kills a test after 90 s and runs the integration binary in a one-thread group. nextest gives each test its own process, so the in-process mutex no longer serializes them. The release dummy-cuebot is built before the tests so its compile doesn't count against a test's timeout. The workspace has no doctests, so nothing is lost by moving off cargo test.
  • Job timeouts: Linux build 45 to 15 min, Windows tests 60 to 20 min.

F2: macOS packaging runner

Since 10 Nov every master packaging run was cancelled with "The configuration 'macos-14-arm64-us-default' is not supported". create_other_artifacts was skipped, so nothing reached S3. Both Apple targets move to macos-15 in packaging and release. x86_64 still cross-compiles from the arm64 runner.

F3: SonarCloud removed

It failed 53 of 53 runs ("Java 17 is not supported"), and nobody acted on it. This removes sonar-cloud-pipeline.yml, sonar-project.properties, ci/python_coverage_report.sh (its only user), and the org.sonarqube plugin and sonarqube {} block in cuebot/build.gradle. JaCoCo stays. There was no README badge. The only remaining mentions of Sonar are in past release notes and TSC meeting minutes, left as historical record.

F4: integration test builds once and fails loudly

About 24% of integration test jobs failed, half of them on the 5-minute compose wait. The script built opencue/cuebot and opencue/rqd, then docker compose up built its own copies because those services had build: and no image:.

  • docker-compose.yml: image: opencue/flyway, opencue/cuebot, opencue/rqd, and build: stays. For sandbox users, docker compose up still builds a missing image. After a code change, rebuild with docker compose build or up --build, as before.
  • ci/run_integration_test.sh builds all three images (flyway is new), starts compose with --no-build, prints any failed build's log (it used to print only RQD's), and prints the last 100 compose log lines on timeout. The 5-minute clock already started after the builds; now nothing rebuilds inside it.

F5: bounded jobs, superseded runs cancelled

  • timeout-minutes on every job: roughly 3x the median of recent successful runs, at least 10 min for jobs that pull containers or build images, and at most 30 min. The exception is manual Maestro runs (workflow_dispatch), which can pick the full-farm scenarios, so they keep 60. Two jobs had previously run to the 6-hour limit while stuck in apt-get.
  • Testing and Rust get concurrency with cancel-in-progress, keyed by PR number. Master pushes are keyed by SHA, so every master commit still runs.
  • The REST gateway tests install protoc with a SHA-pinned arduino/setup-protoc (21.12, the version Ubuntu 24.04 ships). The other apt-get install protobuf-compiler steps also install X11 and other libraries, so they stay.

F6: COMPLETIONSTORM and SOLOFILL are report-only

The nightly passed on only 34% of nights. COMPLETIONSTORM failed 65% of nights on a peak tick time that measures the shared runner as much as the scheduler, and SOLOFILL failed 14%. Their scenario step now has continue-on-error, the step summary says the result is report-only, and logs are archived when they fail. Every scenario now uploads a maestro-sim-metrics-<scenario> JSON artifact (verdict, peak avgTick, final post-op queue, lost reports, fill ratio, throughput, runner CPUs), kept for 90 days. Once about 30 runs are in, the thresholds get set from that data and continue-on-error comes off.

F7: small defects

  • opencue_cuegui_path was never declared as an output of the Testing pipeline's build job, so CueGUI tests ran pip install "[test]" and the install matrix skipped the cuegui wheel. It is declared now. The wheel requires Python > 3.7, so the 3.7 install leg leaves it out until 3.7 is dropped in a later phase.
  • ci/run_gui_test.sh uses set -eo pipefail and passes or fails on pytest's exit code, recorded inside the xvfb session, so an xvfb-run crash on exit still can't fail a passing run. Before, it grepped for "N failed", so collection errors passed.
  • build_metadata.json used $(BUILD_SOURCEVERSION) (Azure syntax, empty). It now uses ${GITHUB_SHA}.
  • Deleted the lint job's "Set package vars" step, which exported into a shell that exited.
  • checkout@v3 to v7, configure-aws-credentials@v1 to v6, login-action@v2 to v4, and the composite action's upload-artifact@v4 to v7. actionlint flagged v1 and v2 as too old to run.

Verification

  • Locally: cargo nextest run on the workspace, 221/221 passed on macOS. The silent-server test returns in 2 s. A deliberately stalled test was killed and named by nextest at 90 s.
  • ./gradlew help / tasks evaluate cleanly without the sonar plugin.
  • actionlint (without shellcheck) goes from 14 findings on master to 3. The 3 that remain predate this PR: the composite action has no description. bash -n and shellcheck pass on the touched scripts (only pre-existing warnings remain). The run_gui_test.sh pass/fail logic was checked with stubbed xvfb-run and pytest.
  • The integration test, the macOS packaging jobs and the Windows tests were not run locally. The PR's checks cover the integration test and Windows. Packaging only runs on master.

Known failure (fix ready, not pushed yet)

"Run Python Unit Tests" (CY2023/CY2024) fails on this head. With set -e, run_gui_test.sh now stops at pip: command not found (the containers have no bare pip). On master the same error was ignored, a collection error followed, and the grep still reported a pass. The fix ("${py}" -m pip), plus mocking the Cuebot stub in two CueGUI test classes that tried to reach a real cuebot, is committed but couldn't be pushed. A wildcard branch-protection rule requires the EasyCLA status on every update to an existing upstream branch. Locally, all 335 CueGUI tests pass with those commits.

Manual follow-ups

  • Delete the SONAR_TOKEN repository secret, and archive or delete the SonarCloud projects AcademySoftwareFoundation_OpenCue and AcademySoftwareFoundation_OpenCue_Cuebot if they are no longer wanted.
  • Required checks: master has no required status checks or rulesets today, so removing the "Analyze Python Components" / "Analyze Cuebot" checks blocks nothing. If someone added them under another name, remove them.
  • Backfill S3: after merge, confirm the first master packaging run finishes and aws s3 ls s3://<bucket>/opencue/<build id>/ shows the full set (jar, RPM, schema, seed SQL, wheels, openrqd binaries, build_metadata.json) before the next release is tagged. If needed, re-run packaging on master's head.
  • F6 recalibration: after about 30 nightly runs, set the COMPLETIONSTORM and SOLOFILL thresholds from the maestro-sim-metrics-* artifacts, update the workflow header (it still assumes 2 vCPUs), and remove continue-on-error.

LLM usage disclosure

Claude (Claude Code) analysed the workflow history, implemented these changes and ran the local checks listed above, at the direction of Diego Tavares.

🤖 Generated with Claude Code

DiegoTavares and others added 7 commits November 19, 2026 14:30
The SonarCloud workflow failed on every master push (53 of 53 runs) because
the scanner no longer accepts Java 17, and nobody acted on the results.
Remove the workflow, sonar-project.properties, the coverage script it was the
only user of, and the org.sonarqube plugin and config in cuebot/build.gradle.

Co-Authored-By: Claude <noreply@anthropic.com>
GitHub no longer serves the macos-14 label ("The configuration
'macos-14-arm64-us-default' is not supported"), so every master packaging
run since 10 Nov was cancelled at the macOS jobs and the S3 upload in
create_other_artifacts was skipped. Use macos-15 in packaging and release;
x86_64-apple-darwin keeps cross-compiling from the arm64 runner.

Co-Authored-By: Claude <noreply@anthropic.com>
monitor_server_output only checked its deadline after reader.lines() yielded
a line, so a silent dummy-cuebot blocked the test forever. That hung
windows-tests until the 60-minute job timeout on 54 of 55 sampled runs and the
Linux build job on 27% of runs.

- Read child stdout and stderr on background threads and wait on a channel
  with recv_timeout, so the deadline holds without output. The server is
  killed and reaped on timeout.
- Drain openrqd's output the same way. It logs at debug level to a pipe
  nobody read, which can fill and stall rqd.
- Add a test that feeds the monitor a silent child.
- Run Rust tests with cargo nextest. A test is killed after 90s, and the
  integration binary runs in a single-threaded group since nextest gives each
  test its own process and the in-process mutex no longer serializes them.
- Pre-build the release dummy-cuebot outside the per-test timeout, and drop
  the job timeouts to 15 minutes (Linux) and 20 minutes (Windows).

Co-Authored-By: Claude <noreply@anthropic.com>
run_integration_test.sh built opencue/cuebot and opencue/rqd, then docker
compose up built its own copies because those services had build: and no
image:. On a layer cache miss the second build ate the 5-minute wait and the
job failed with "Timed out waiting for Docker compose".

- Name the flyway, cuebot and rqd images in docker-compose.yml so compose
  reuses the images the script builds, and start it with --no-build.
- Build the flyway image in the script alongside the others.
- Print the build log whenever an image build fails (it was only printed for
  RQD), and the tail of the compose log when the wait times out.

Co-Authored-By: Claude <noreply@anthropic.com>
The nightly Maestro run was red on 66% of nights, mostly COMPLETIONSTORM
failing its peak tick threshold (65% of nights) and SOLOFILL (14%). Those
thresholds measure the shared runner as much as the scheduler, so a red
nightly stopped carrying information.

Run both with continue-on-error and record every scenario's numbers (peak
tick, post-op queue, lost reports, fill ratio, throughput) as a JSON artifact
kept for 90 days, so the thresholds can be reset from the observed
distribution before they gate again. Logs are archived for a report-only
failure too.

Co-Authored-By: Claude <noreply@anthropic.com>
- Declare opencue_cuegui_path as an output of the Testing pipeline's build
  job. It was never declared, so CueGUI tests ran pip install "[test]" and
  the install matrix silently skipped the cuegui wheel. That wheel requires
  Python > 3.7, so the 3.7 install leg leaves it out.
- run_gui_test.sh: run with set -eo pipefail and decide on pytest's exit
  code, recorded inside the xvfb session so an xvfb-run crash on exit still
  cannot fail a passing run. Grepping for "N failed" let collection errors
  pass.
- Write the commit SHA into build_metadata.json with ${GITHUB_SHA}.
  $(BUILD_SOURCEVERSION) is Azure syntax and produced an empty commit.
- Drop the lint job's "Set package vars" step, which exported into a shell
  that exited immediately.
- Move checkout@v3, configure-aws-credentials@v1, login-action@v2 and the
  composite action's upload-artifact@v4 to current majors (v7, v6, v4, v7).

Co-Authored-By: Claude <noreply@anthropic.com>
Two jobs ran to GitHub's 6-hour limit stuck in apt-get, and neither had a
timeout. Superseded PR pushes kept running to the end because the Testing and
Rust workflows had no concurrency group.

- Give every job a timeout-minutes of roughly three times its median
  duration over recent successful runs, at least 10 minutes for jobs that
  pull containers or build images, and at most 30 minutes. Manual
  Maestro sim runs keep a longer ceiling because they can pick the full-farm
  scenarios.
- Cancel in-progress Testing and Rust runs when a pull request gets a new
  push. Master pushes are grouped by commit, so every commit still runs.
- Install protoc for the REST gateway tests with a pinned setup-protoc
  instead of apt-get.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@DiegoTavares

Copy link
Copy Markdown
Collaborator Author

Superseded by #2648, which carries the same changes from a fork branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant