From d4457ff34ccb0484041dfdff6852c272cd8abc1e Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Fri, 22 May 2026 12:33:24 +0200 Subject: [PATCH 1/2] scripts: improve trigger-pr-roachtest.sh usage documentation 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 --- scripts/trigger-pr-roachtest.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/trigger-pr-roachtest.sh b/scripts/trigger-pr-roachtest.sh index 5bb127f249cb..a157fe42dd68 100755 --- a/scripts/trigger-pr-roachtest.sh +++ b/scripts/trigger-pr-roachtest.sh @@ -13,6 +13,16 @@ if [ -z $token ]; then TEAMCITY_TOKEN not set. Get one here: https://teamcity.cockroachdb.com/profile.html?item=accessTokens + +Usage: $0 [sha] + +Examples: + $0 12345 'perturbation/full/intents' + $0 my-branch-name 'kv/splits.*' a1b2c3d4 + +Note: PR numbers work for all cases (recommended). Branch names only work +for branches pushed directly to cockroachdb/cockroach, not personal forks. +For fork branches, use the PR number instead. EOF exit 1 fi @@ -20,7 +30,7 @@ fi pr=${1-} while [ -z $pr ]; do - read -p 'PR number (defaults to first arg, can also use branch name): ' pr + read -p 'PR number or branch name (PR number recommended): ' pr done tests=${2-} From 474b41b4086af84eb5b557461de2fb2b48e4e993 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Wed, 27 May 2026 11:13:41 +0200 Subject: [PATCH 2/2] scripts: default trigger-pr-roachtest.sh to USE_SPOT=never 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 --- scripts/trigger-pr-roachtest.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/trigger-pr-roachtest.sh b/scripts/trigger-pr-roachtest.sh index a157fe42dd68..97a91c10acbb 100755 --- a/scripts/trigger-pr-roachtest.sh +++ b/scripts/trigger-pr-roachtest.sh @@ -23,6 +23,14 @@ Examples: Note: PR numbers work for all cases (recommended). Branch names only work for branches pushed directly to cockroachdb/cockroach, not personal forks. For fork branches, use the PR number instead. + +Environment variables: + COUNT - number of test iterations (default: 1) + DEBUG - enable debug mode (default: false) + USE_SPOT - use spot VMs: never, auto, always (default: never) + The "auto" default in nightly scripts uses spot for the + first attempt, which causes preemptions on single-iteration + PR-triggered runs. Override here defaults to "never". EOF exit 1 fi @@ -60,6 +68,7 @@ json_payload=$(jq -n \ --arg tests "$tests" \ --arg envDebug "${DEBUG-false}" \ --arg envCount "${COUNT-1}" \ + --arg envUseSpot "${USE_SPOT-never}" \ '{ buildType: {id: "Cockroach_Nightlies_RoachtestNightlyGceBazel"}, branchName: $branch_name, @@ -70,7 +79,8 @@ json_payload=$(jq -n \ {name: "env.SELECT_PROBABILITY", value: "1.0"}, {name: "env.DEBUG", value: $envDebug}, {name: "env.COUNT", value: $envCount}, - {name: "env.TESTS", value: $tests} + {name: "env.TESTS", value: $tests}, + {name: "env.USE_SPOT", value: $envUseSpot} ] } }')