Skip to content

[TS PBT] Charge adapter startup to the generation allowance - #691

Open
CaelmBleidd wants to merge 2 commits into
caelmbleidd/pbt-generation-budget-receiptsfrom
caelmbleidd/pbt-charge-startup-before-generation
Open

CaelmBleidd wants to merge 2 commits into
caelmbleidd/pbt-generation-budget-receiptsfrom
caelmbleidd/pbt-charge-startup-before-generation

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

Based on #594. The JVM's supervised process timer starts before Node worker, module and example preparation, but the previous soft interruption timer starts only when fast-check begins. Startup could therefore consume the time intended for writing native receipts and coverage.

Pass the caller's soft generation deadline to Node. The adapter reduces the relative fast-check allowance by the time spent before generation. If preparation consumes the entire allowance, return the existing timeout and empty capture metadata before entering fast-check. That path preserves an explicit seed and emits a signed 32-bit placeholder when the request supplied none. The JVM hard deadline, cleanup behavior and the format of complete results remain unchanged.

A deterministic test loads a module that outlasts the soft deadline and configures fast-check's random generator to throw if entered. The result is a timeout with zero runs and no captured inputs despite an out-of-range global seed. The old path entered fast-check and ran the predicate after the deadline.

A single real Mailbox A/B used the exact same PBT-only 24-second request. Both runs returned input exports, so that check did not reproduce the previously recorded transport failure. The new run returned earlier and preserved source statements, with exact branch conversion marked incomplete. This change does not recover buffered data once the supervisor has terminated a process.

Validation includes 221 Node tests, focused Kotlin campaign/deadline tests, and FastCheck Detekt on JDK 11 and Node 22.

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