Skip to content

scripts: improve trigger-pr-roachtest.sh#171008

Merged
trunk-io[bot] merged 2 commits into
cockroachdb:masterfrom
tbg:tbg/trigger-pr-roachtest-improvements
May 27, 2026
Merged

scripts: improve trigger-pr-roachtest.sh#171008
trunk-io[bot] merged 2 commits into
cockroachdb:masterfrom
tbg:tbg/trigger-pr-roachtest-improvements

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented May 27, 2026

Two small improvements to scripts/trigger-pr-roachtest.sh:

  1. Better help text: Clarify that PR numbers are recommended over branch names. Branch names only work for branches pushed directly to cockroachdb/cockroach, not personal forks. Triggering by branch name from a fork results in TeamCity reporting "branch does not correspond to any branch monitored by the build VCS roots" and the test being ignored.

  2. Default USE_SPOT=never: The nightly TeamCity script (perturbation_nightly_metamorphic_impl.sh and roachtest_nightly_impl.sh) invokes roachtest with --use-spot="${USE_SPOT:-auto}". The auto mode uses spot VMs for the first attempt, falling back to non-spot if the test fails due to preemption. This works well for the nightly run (COUNT>1) where the fallback recovers preempted tests.

    PR-triggered runs typically use COUNT=1, so there is no second attempt and every spot preemption surfaces as a test failure. The triggered build's report shows "VMs preempted during the test run" rather than real test results, making it impossible to evaluate the change. Default USE_SPOT to "never" so PR-triggered runs get real (non-spot) VMs. Callers who want the legacy behavior can still set USE_SPOT=auto explicitly.

Motivation

Both findings came out of trying to validate #170724 (re-enabling perturbation/full tests). The first two attempts saw 5/6 tests fail with VM preemptions, masking the actual test behavior. Once USE_SPOT=never was set, 5/6 tests passed cleanly. See the test results table in #170724 (comment) for the before/after.

Epic: none

Release note: None

tbg added 2 commits May 27, 2026 16:30
Clarify that PR numbers are recommended over branch names, as branch
names only work for branches pushed directly to cockroachdb/cockroach,
not personal forks. When triggering roachtests from fork branches,
TeamCity fails with "branch does not correspond to any branch monitored
by the build VCS roots" and marks the test as ignored.

Using the PR number works in all cases, as TeamCity can resolve PR
branches regardless of which repository they originate from.

Release note: None
The nightly TeamCity script (perturbation_nightly_metamorphic_impl.sh
and roachtest_nightly_impl.sh) invoke roachtest with
--use-spot="${USE_SPOT:-auto}". The "auto" mode uses spot VMs for the
first attempt, falling back to non-spot if the test fails due to
preemption. This works well for the nightly run (COUNT>1) where the
fallback recovers preempted tests.

PR-triggered runs typically use COUNT=1, so there is no second attempt
and every spot preemption surfaces as a test failure. The triggered
build's report shows "VMs preempted during the test run" rather than
real test results, making it impossible to evaluate the change.

Default USE_SPOT to "never" in the trigger script so PR-triggered runs
get real (non-spot) VMs by default. Callers who want the legacy
behavior can still set USE_SPOT=auto explicitly.

Release note: None
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 27, 2026

😎 Merged successfully - details.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@tbg tbg marked this pull request as ready for review May 27, 2026 14:32
@tbg tbg requested a review from arulajmani May 27, 2026 14:32
@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented May 27, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

@trunk-io trunk-io Bot merged commit 5be101c into cockroachdb:master May 27, 2026
38 of 40 checks passed
@tbg tbg deleted the tbg/trigger-pr-roachtest-improvements branch May 27, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants