Skip to content

Tests: the shared render really is shared, and the reload's re-check under its claim (#199's weak and untested spots) - #226

Open
ndbroadbent wants to merge 2 commits into
mainfrom
weak-tests
Open

ndbroadbent wants to merge 2 commits into
mainfrom
weak-tests

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

The #199 review's weak and untested spots:

  • Shared render (renderer.rs): "the build sharing it doesn't pay again" passed even if the second build was never charged. Now it also checks:

    • both builds read the same render (through effective_snapshots, since the second build's group reads the first build's row);
    • the first build is charged for 2 rendered pages;
    • the second was charged, with 0 rendered pages.
  • Re-check under the reload's claim (billing_branches.rs): untested. A trigger on the claim's own UPDATE stands in for the race: another reload's pack lands, or the organization moves to Free, between the first checks and the claim. The re-check buys nothing in either case. Both tests fail with the re-check switched off.

  • Reused image diff (processing.rs): the test now checks that the second project's changed page points at the diff row the first project made, as well as that it wasn't charged for it.

  • Order and error path of a finished build (processing.rs): untested. Recording listeners in the test binary show that BuildChanged (the check and live pages) is heard before CreditsSpent. With the check's listener failing (a forge that's down), billing still hears. The test fails if finished() swaps the order or returns early on the check's error.

Tests only.

This branch has not been deployed

No deployments
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