Allow cancellation errors in tests that allow timeline deletion errors (#12315)

After merging of PR https://github.com/neondatabase/neon/pull/11712 we
saw some tests be flaky, with errors showing up about the timeline
having been cancelled instead of having been deleted. This is an outcome
that is inherently racy with the "has been deleted" error.

In some instances, https://github.com/neondatabase/neon/pull/11712 has
already added the error about the timeline having been cancelled. This
PR adds them to the remaining instances of
https://github.com/neondatabase/neon/pull/11712, fixing the flakiness.
This commit is contained in:
Arpad Müller
2025-06-24 00:26:38 +02:00
committed by GitHub
parent 5eecde461d
commit 0efff1db26
3 changed files with 12 additions and 4 deletions

View File

@@ -3642,7 +3642,9 @@ def test_timeline_delete_mid_live_migration(neon_env_builder: NeonEnvBuilder, mi
env.start() env.start()
for ps in env.pageservers: for ps in env.pageservers:
ps.allowed_errors.append(".*Timeline.* has been deleted.*") ps.allowed_errors.extend(
[".*Timeline.* has been deleted.*", ".*Timeline.*was cancelled and cannot be used"]
)
tenant_id = TenantId.generate() tenant_id = TenantId.generate()
timeline_id = TimelineId.generate() timeline_id = TimelineId.generate()

View File

@@ -1099,7 +1099,9 @@ def test_timeline_detach_ancestor_interrupted_by_deletion(
for ps in env.pageservers: for ps in env.pageservers:
ps.allowed_errors.extend(SHUTDOWN_ALLOWED_ERRORS) ps.allowed_errors.extend(SHUTDOWN_ALLOWED_ERRORS)
ps.allowed_errors.append(".*Timeline.* has been deleted.*") ps.allowed_errors.extend(
[".*Timeline.* has been deleted.*", ".*Timeline.*was cancelled and cannot be used"]
)
pageservers = dict((int(p.id), p) for p in env.pageservers) pageservers = dict((int(p.id), p) for p in env.pageservers)
@@ -1221,7 +1223,9 @@ def test_sharded_tad_interleaved_after_partial_success(neon_env_builder: NeonEnv
for ps in env.pageservers: for ps in env.pageservers:
ps.allowed_errors.extend(SHUTDOWN_ALLOWED_ERRORS) ps.allowed_errors.extend(SHUTDOWN_ALLOWED_ERRORS)
ps.allowed_errors.append(".*Timeline.* has been deleted.*") ps.allowed_errors.extend(
[".*Timeline.* has been deleted.*", ".*Timeline.*was cancelled and cannot be used"]
)
pageservers = dict((int(p.id), p) for p in env.pageservers) pageservers = dict((int(p.id), p) for p in env.pageservers)

View File

@@ -25,7 +25,9 @@ def test_gc_blocking_by_timeline(neon_env_builder: NeonEnvBuilder, sharded: bool
initial_tenant_shard_count=2 if sharded else None, initial_tenant_shard_count=2 if sharded else None,
) )
for ps in env.pageservers: for ps in env.pageservers:
ps.allowed_errors.append(".*Timeline.* has been deleted.*") ps.allowed_errors.extend(
[".*Timeline.* has been deleted.*", ".*Timeline.*was cancelled and cannot be used"]
)
if sharded: if sharded:
http = env.storage_controller.pageserver_api() http = env.storage_controller.pageserver_api()