maybe fix test cases?

Signed-off-by: Alex Chi Z <chi@neon.tech>
This commit is contained in:
Alex Chi Z
2025-07-18 15:55:21 -04:00
parent 59bb30669c
commit e635891dbb
3 changed files with 12 additions and 4 deletions

View File

@@ -621,6 +621,7 @@ def test_timeline_deletion_with_files_stuck_in_upload_queue(
path
for path in remote_timeline_path.iterdir()
if not (path.name.endswith("initdb.tar.zst"))
and not (path.name.startswith("index_part.json"))
]
assert len(filtered) == 0

View File

@@ -410,6 +410,7 @@ def test_scrubber_physical_gc_timeline_deletion(neon_env_builder: NeonEnvBuilder
# Delete the timeline
env.storage_controller.pageserver_api().timeline_delete(tenant_id, timeline_id)
time.sleep(1) # give scrubber some time to wait for min_age_secs
# Subsequently doing physical GC should clean up the ancestor layers
gc_summary = env.storage_scrubber.pageserver_physical_gc(min_age_secs=0, mode="full")

View File

@@ -491,7 +491,7 @@ def test_timeline_archival_chaos(neon_env_builder: NeonEnvBuilder):
return (active_ids, offloaded_ids)
def timeline_objects(tenant_shard_id, timeline_id):
def timeline_objects_exclude_index_part(tenant_shard_id, timeline_id):
response = list_prefix(
env.pageserver_remote_storage, # type: ignore
prefix="/".join(
@@ -505,7 +505,11 @@ def test_timeline_archival_chaos(neon_env_builder: NeonEnvBuilder):
+ "/",
)
return [k["Key"] for k in response.get("Contents", [])]
return [
k["Key"]
for k in response.get("Contents", [])
if not k["Key"].startswith("index_part.json")
]
def worker():
"""
@@ -533,7 +537,7 @@ def test_timeline_archival_chaos(neon_env_builder: NeonEnvBuilder):
state.created = True
if (
timeline_objects(
timeline_objects_exclude_index_part(
tenant_shard_id=tenant_shard_id, timeline_id=state.timeline_id
)
== []
@@ -550,7 +554,9 @@ def test_timeline_archival_chaos(neon_env_builder: NeonEnvBuilder):
violations.append(msg)
raise RuntimeError(msg)
objects = timeline_objects(tenant_shard_id, state.timeline_id)
objects = timeline_objects_exclude_index_part(
tenant_shard_id, state.timeline_id
)
if len(objects) == 0:
log.info(f"Confirmed deletion of timeline {state.timeline_id}")
timelines_deleted.append(state.timeline_id)