Skip to content

test(review): stop RescuedFindingLostWriteTest sleeping through the content-creation floor - #752

Merged
devops-thiago merged 1 commit into
fix/748-review-body-deliveryfrom
fix/749-test-runtime
Aug 16, 2026
Merged

test(review): stop RescuedFindingLostWriteTest sleeping through the content-creation floor#752
devops-thiago merged 1 commit into
fix/748-review-body-deliveryfrom
fix/749-test-runtime

Conversation

@devops-thiago

@devops-thiago devops-thiago commented Aug 16, 2026

Copy link
Copy Markdown
Owner

What type of PR is this?

  • ✅ Test

Stacked PR. Based on fix/748-review-body-delivery (#751) so its diff stays scoped to this issue. Re-target to main once #751 merges.

Description

RescuedFindingLostWriteTest's fixture threw GitHub's content-creation block with Retry-After: 0 and documented that as "naming a deadline of 'now' so the test does not sleep". That was true when it was written. #738 then made CONTENT_CREATION_BLOCK_MIN_DELAY (30 s) apply however the delay was derived, an explicit Retry-After included — and shipped in the same release. Every attempt of every exhausted route has waited the floor ever since: 3 sleeps per route, 6 exhausted routes across the class.

Neither change is wrong. The fixture simply encodes an assumption that stopped being true.

What these tests actually need from the throttle is that GitHubApiError.isThrottled says yes and that the route burns GitHubWriteRetry.MAX_ATTEMPTS. A plain secondary rate limit does both, and nothing in the class asserts on the block wording — the assertions are all about accounting. So BLOCK_BODY becomes THROTTLE_BODY, a plain secondary-limit message, with a comment on why it is deliberately not a content-creation block so the next reader does not "restore" it. All three tests and every assertion in them are unchanged.

Related Issues

Fixes #749

Proof: audit report AUDIT7-A, finding A3.

How Has This Been Tested?

  • Unit tests

This is a build-cost fix with no behavioural change, so there is no red/green proof to quote — the three tests pass before and after, on the same assertions, and that is the point. The evidence is the measured wall clock, before and after, on the same machine and JVM.

Before (surefire XML, this branch's parent)

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 461.1 s -- in RescuedFindingLostWriteTest

CLASS 461.054
aFindingTheFileLevelFallbackRescuedIsNotAnnouncedAsLost   94.013
aRescuedFindingWithASuggestionIsNotAnnouncedTwiceEither  184.004
aFindingNoRouteCouldDeliverIsStillAnnouncedAsLost        182.998

After

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.97 s -- in RescuedFindingLostWriteTest

CLASS 25.974
aFindingTheFileLevelFallbackRescuedIsNotAnnouncedAsLost    6.954
aRescuedFindingWithASuggestionIsNotAnnouncedTwiceEither    9.984
aFindingNoRouteCouldDeliverIsStillAnnouncedAsLost          9.002

461.05 s → 25.97 s for the class (−435 s, 17.7x), 94.01 s → 6.95 s for the single test. The 94 s figure was 3 x 30 s of floor plus overhead, to the second; what remains is the retry pacing the seam genuinely exercises.

A whole clean test on this branch drops from 12:22 to 04:40.

Gates

  • spotless:applyclean compile spotbugs:check spotless:check: BugInstance size is 0, BUILD SUCCESS
  • clean test: Tests run: 3308, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
  • Coverage: no main code changed by this PR, so there is nothing new to cover.

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • My changes generate no new warnings or errors

…loor

The fixture threw a content-creation block with `Retry-After: 0` and
documented that as "so the test does not sleep". #738 then made the
30-second content-creation floor apply however the delay was derived, an
explicit `Retry-After` included — so every attempt of every exhausted
route now waited the floor, and the premise the fixture was built on
stopped holding in the same release that shipped it.

What these tests need from the throttle is that `isThrottled` says yes
and that the route burns `GitHubWriteRetry.MAX_ATTEMPTS`; a plain
secondary rate limit does both, and no assertion here reads the block
wording. Swapping the body keeps all three tests and their assertions
exactly as they are while dropping the class from 461.05 s to 25.97 s,
and the single-test case from 94.01 s to 6.95 s. A full `clean test`
goes from 12:22 to 04:40.

Fixes #749
@thrillhousebot

Copy link
Copy Markdown
Contributor

🤖 ThrillhouseBot PR Summary

What this PR does

This PR changes the RescuedFindingLostWriteTest fixture from a GitHub content-creation block message to a plain secondary-rate-limit message, renaming BLOCK_BODY to THROTTLE_BODY and rewriting the surrounding comments to explain that the content-creation floor introduced in #738 no longer applies. All three tests and their assertions are unchanged; the goal is to keep the retry/accounting seam exercised while cutting the test class wall-clock time from ~461s to ~26s.

Description vs. Implementation

No mismatch found between the PR description and the change.

Changes Overview

  • Files changed: 1
  • Lines added: +20
  • Lines removed: -9

Changed Files

File Change Summary
src/test/java/dev/thiagogonzaga/thrillhousebot/review/RescuedFindingLostWriteTest.java Modified Swap the content-creation block fixture body for a plain secondary-rate-limit body, with updated Javadoc explaining why the block wording was deliberately dropped.

Risk Assessment

Risk Count
🔴 Critical 0
🟠 High 0
🟡 Medium 0
🔵 Low 0

Everything's coming up Thrillhouse! 🎉

No issues found in this PR.


Automated review by ThrillhouseBot. Reply with /review to re-run.

@thrillhousebot thrillhousebot Bot added performance Speed or resource-usage improvement testing Test coverage and test quality labels Aug 16, 2026
@devops-thiago
devops-thiago merged commit ca10dac into fix/748-review-body-delivery Aug 16, 2026
1 check passed
@devops-thiago
devops-thiago deleted the fix/749-test-runtime branch August 16, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Speed or resource-usage improvement testing Test coverage and test quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant