Improve more stability of worker_spi termination test
Michael Paquier <michael@paquier.xyz>
Improve more stability of worker_spi termination test Alexander Lakhin has noticed that it can be possible on machines with slow storage to have the spawned workers be stuck in initialize_worker_spi(), before they reach their main loop. Waiting for a flush to happen would block the interrupt attempts done by the database commands, causing the test to fail on timeout once the number of interrupt attempts is reached in CountOtherDBBackends(). This commit switches the test to wait for the spawned bgworkers to reach their main loops before attempting the database commands that would trigger the interrupts, napping for a time larger than the default, with worker_spi.naptime set at 10 minutes. Another thing that could be attempted is to enforce a larger number of tries in CountOtherDBBackends(), if what is done here is not enough. Let's see first if what this commit does is enough for the buildfarm members widowbird and jay. Analyzed-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/f913fba1-da59-404c-9eb3-07c7304be637@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/test/modules/worker_spi/t/002_worker_terminate.pl | modified | +10 −8 |
Discussion
- [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE 74 messages · 2025-10-03 → 2026-04-05