Skip to content

Commit 065c90d

Browse files
committed
Fix race-condition in recompression_spin_lock_test
1 parent 8fdfdb3 commit 065c90d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tsl/test/t/005_recompression_spin_lock_test.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
$s3->query_safe(
151151
"SELECT debug_waitpoint_release('chunk_recompress_after_latch');");
152152

153+
# Session 1 re-acquires the lock asynchronously after the waitpoint is
154+
# released, so poll until it shows up before asserting.
155+
$node->poll_query_until('postgres',
156+
"SELECT count(*) > 0 FROM pg_locks WHERE relation::regclass::text LIKE '%hyper_1_%chunk' AND granted AND mode = 'ExclusiveLock';"
157+
) or die "timed out waiting for ExclusiveLock on uncompressed chunk";
158+
153159
# Verify ExclusiveLock on uncompressed chunk
154160
$result = $node->safe_psql('postgres',
155161
"SELECT relation::regclass::text FROM pg_locks WHERE relation::regclass::text LIKE '%hyper_1_%chunk' AND granted AND mode = 'ExclusiveLock';"

0 commit comments

Comments
 (0)