Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/test_testgres_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,25 @@ def test_kill_backgroud_writer__ok(
assert node.is_started
node_pid = node.pid
assert type(node_pid) is int

# --- We expect BackgroundWriter to appear under load ------------------------
bw_attempt = 0
while True:
aux_pids = node.auxiliary_pids
assert type(aux_pids) is dict

if ProcessType.BackgroundWriter in aux_pids:
break

bw_attempt += 1
# We give the server up to 3 seconds to start all background workers.
if bw_attempt == 30:
raise RuntimeError("BackgroundWriter process did not start in time under heavy load.")

time.sleep(0.1)
continue

# ----------------------------------------------------------------------------
aux_pids = node.auxiliary_pids
assert type(aux_pids) is dict
assert ProcessType.BackgroundWriter in aux_pids
Expand Down