Skip to content

Flaky: backup AC-4.8 example finds no price change committed during the prices snapshot #432

Open

Description

@plainprogrammer

What happened

spec/lib/collector/backup/create_spec.rb:286 (spec 081 AC-4.8, "keeps committing price changes while the prices snapshot is taken") failed on CI for a documentation-only PR (#431, head 114dd4f2), RSpec shard 2/4, seed 22065:

Failure/Error: expect(rows.count { |_kind, _started, finished| window.cover?(finished.to_f) }).to be_positive, "no price change committed while the prices snapshot was taken"
1257 examples, 1 failure

Run: https://github.com/plainprogrammer/Collector/actions/runs/43626438509/job/132543197989

The other two expectations (no writer errors, no commit past the 5-second busy timeout) passed, so the writer kept working; no commit landed inside the measured window :prices_starting..:prices_written.

Likely cause (unverified)

The example depends on timing: the window is as long as the snapshot of a 50,000-row prices database takes. On a fast runner the snapshot can finish between two of the child writer's commits, so the count is zero while the behaviour under test (the writer isn't blocked) holds.

Reproduce

CI=true bin/rspec --seed 22065 spec/lib/collector/backup/create_spec.rb:286

(Or bin/ci rspec 2/4 for the shard's files, order and seed.) Not yet tried locally.

Possible fixes

  • Make the window long enough by construction (a larger seed table, or a checkpoint hook that holds the snapshot open until the log shows a commit after :prices_starting).
  • Or assert on what AC-4.8 protects (no commit waited past the busy timeout, none errored) and drop the in-window count.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions