Skip to content

test(acceptance): check #2332's run outcomes, not their stamps (#2347) - #2348

Merged
cjimti merged 1 commit into
mainfrom
fix/2347-2332-criterion-stamps
Oct 28, 2026
Merged

cjimti merged 1 commit into
mainfrom
fix/2347-2332-criterion-stamps

Conversation

@cjimti

@cjimti cjimti commented Oct 28, 2026

Copy link
Copy Markdown
Member

Changes test/acceptance/issue_2332_test.go: TestIssue2332_TenEventsRunTenTimesOneAtATime checks each run's outcome instead of comparing the timestamps of different runs. It was the only failure in E2E Nightly run 40601346075 on 82fe75f (11 of 12 jobs passed).

Why

The failure read run 1 started at 23:49:05.200296, before the one before it ended at 23:49:05.200845. No two runs overlapped:

  1. idx_script_runs_queued_running (migration 000205) allows one running row per script. TestRealDB_AQueuedRunWaitsForTheRunningOne proves it against a real PostgreSQL.
  2. Claim stamps started_at = NOW() (internal/platform/scriptstore/runs.go:415). NOW() is the moment the claim transaction began. That is before the claim waits on the index for the previous run's finish (finished_at = NOW(), runs.go:462) to commit.
  3. So two serial runs' stamps can cross by the length of that wait, here 0.55 ms. The comparison could fail without an overlap and could not show one.

What changes

  1. The criterion asserts ten runs with ten distinct event ids, each with status succeeded, and names any run that ended otherwise with its error.
  2. The start/finish comparison is removed, along with the sort import it used.
  3. The test's comment names the index that enforces one running run and the real-database test that proves it.

The release gate is unchanged: a red E2E Nightly still refuses a final tag.

Verification

  1. make acceptance ISSUE=2332 on the local stack: all three TestIssue2332_* criteria pass, recorded at build/2332/acceptance.jsonl.
  2. go vet -tags=integration ./test/acceptance/: ok.

This PR changes issue_2332_test.go, so its CI runs Acceptance (changed criteria) for #2332 on a fresh Linux stack (#2341).

Closes #2347

1. TestIssue2332_TenEventsRunTenTimesOneAtATime (test/acceptance/issue_2332_test.go) asserts ten runs with ten distinct event ids, each succeeded, and no longer compares the started_at and finished_at of different runs. A run's started_at is its claim transaction's NOW(), taken before the claim waits on idx_script_runs_queued_running for the previous run's finish to commit, so two serial runs' stamps crossed by 0.55 ms on E2E Nightly run 40601346075 with no overlap. The comment names the index that enforces one running run and TestRealDB_AQueuedRunWaitsForTheRunningOne, which proves it.

Closes #2347
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.80%. Comparing base (82fe75f) to head (74e43b4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2348      +/-   ##
==========================================
- Coverage   94.81%   94.80%   -0.01%     
==========================================
  Files        1443     1443              
  Lines      117111   117111              
==========================================
- Hits       111033   111030       -3     
- Misses       6058     6061       +3     
  Partials       20       20              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cjimti
cjimti merged commit c453e80 into main Oct 28, 2026
22 of 24 checks passed
@cjimti
cjimti deleted the fix/2347-2332-criterion-stamps branch October 28, 2026 06:37
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.

test(acceptance): #2332's one-at-a-time criterion compares stamps from different transactions

1 participant