commit compras4 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 19:13:31 +02:00
parent 9cf9764710
commit 7486007fcf
41 changed files with 1270 additions and 66 deletions
+17
View File
@@ -1,5 +1,22 @@
<?php
test('cycle contention requires all three real lock and single-effect receipts', function () {
$command = ['php', 'worker.php', 'compras_receipts_test_000000000001', 'race-cycles'];
$rows = [];
foreach (['same_operation' => [200, 200], 'different_operations' => [200, 409], 'late_decision' => [200, 409]] as $scenario => $statuses) {
$rows[] = ['scenario' => $scenario, 'statuses' => $statuses, 'blocked_writers_observed' => 2, 'returns' => 1, 'reserve_minor' => 0, 'late_approvals' => 0];
}
$rows[] = ['old_cycle_runtime_rejected_before_balance' => true, 'status' => 503];
$output = function () use (&$rows) {
return implode("\n", array_map(fn ($row) => json_encode($row, JSON_THROW_ON_ERROR), $rows));
};
expect(landedQaReceiptsVerified($command, $output()))->toBeTrue();
$rows[2]['late_approvals'] = 1;
expect(landedQaReceiptsVerified($command, $output()))->toBeFalse();
array_pop($rows);
expect(landedQaReceiptsVerified($command, $output()))->toBeFalse();
});
test('capital register contention requires both actual lock receipts and one immutable version per scenario', function () {
$command = ['php', 'worker.php', 'compras_receipts_test_000000000001', 'race-capital'];
$rows = [];