Skip to content

test(magento): the table queue contention is deterministic (#731) - #1042

Merged
gplanchat merged 1 commit into
mainfrom
fix/table-queue-contention-test
Oct 9, 2026
Merged

gplanchat merged 1 commit into
mainfrom
fix/table-queue-contention-test

Conversation

@gplanchat

Copy link
Copy Markdown
Owner

What

twoWorkersNeverTakeTheSameMessage failed in the magento-boot job on Mage-OS 2.2.0 / PHP 8.2 (run 37977359579): one worker finished its 60 messages before the other had started, so min($counts) was 0. The two worker processes now connect, then wait on a barrier directory until both are ready, and only then start taking. The assertions are unchanged: 60 ids, 60 distinct, and the minimum count above 0.

The drain mode of Fixture/worker.php takes an optional barrier directory and a worker count. A worker that does not see its peer within 60 seconds exits with 1.

Checked

The files pass php-cs-fixer and php -l. The test itself needs a Magento install and MySQL 8.4, so it skipped here (6 of 6 skipped): it has not run on my machine. The pull request's CI is the check.

Not in this pull request

The barrier makes a one-sided drain very unlikely, not impossible: each message costs at least 5 ms, so a worker needs 300 ms of lead over its peer to finish alone. If the job still flakes, the next step is to hold the row lock of the first message in the test's own connection so SKIP LOCKED must skip it.

Refs #731 #738

@gplanchat
gplanchat merged commit b2447a0 into main Oct 9, 2026
45 checks passed
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