Skip to main content

Module transaction_phase

Module transaction_phase 

Source
Expand description

Test-only transaction phase markers, compiled into the release executable and armed only by an environment variable. What: Test-only transaction phase markers for crash and interleaving suites. An explicit environment variable arms one marker: CLI_GIT_TEST_ONLY_PHASE_SIGNAL=<phase>:kill ends the process with SIGKILL at the phase, <phase>:kill:<directory> writes <directory>/<phase>.reached first, and <phase>:pause:<directory> writes that marker and waits until <directory>/<phase>.release exists. A repeatable phase numbers its files by occurrence: <phase>-<n>.reached. Why: Crash suites need a deterministic point to kill the wrapper. The marker is compiled into the release executable, but only the explicit variable arms it, and a malformed value fails the invocation at every phase it reaches instead of being ignored (src/policy-engine/commit-transaction-test-phase.ts).

In TS you’d write (pseudocode):

await reachTransactionPhase({ phase: 'ref-updated' });

Structs§

PhaseSignal
What: One parsed marker. Why: Parsing happens at every phase reached, so a malformed value fails wherever it is read.
PhaseSignalError
What: The marker variable is malformed. Why: The invocation fails with this text instead of ignoring the value.

Enums§

Phase
What: One transaction phase a marker can name. Why: The landing reaches four of them; the others are reached by the commit path and the replay.
PhaseAction
What: What a marker does at its phase. Why: kill ends the process; pause hands control to the test until the release file exists.
PhaseMarkerError
What: Why a reached phase could not be completed. Why: A malformed value and a failed marker write are both fatal to the invocation.

Constants§

PHASE_SIGNAL_VARIABLE
Environment variable arming one phase marker.
TRANSACTION_TEST_PHASES
Every phase in transaction order, which the refusal message lists.

Functions§

parse_phase_signal
What: Parses the marker variable. Why: The phase must match exactly, the action must be kill or pause, a pause needs a directory, and a directory must be absolute. An empty directory after kill counts as no directory, as the incumbent’s parser reads it.
reach_transaction_phase
What: Reaches one phase, reading the marker variable from the process environment. Why: The landing calls this at each marked phase; an unset variable costs one environment lookup.