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
40 changes: 28 additions & 12 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2251,8 +2251,17 @@ def _test_library_facade(self, workspace_id: int, table_id: str) -> None:

assert kbc.files.read_bytes(meta.id) == payload, "read_bytes round-trip mismatch"

listed = kbc.files.list(tags=[facade_tag])
assert any(f.id == meta.id for f in listed), "uploaded file must appear in list"
# The tag-filtered Files list is read-after-write eventually
# consistent: the upload is durable (read_bytes round-tripped it
# just above), but the tag index can lag a few seconds. Poll instead
# of asserting the first list (intermittently missed in CI 2026-07-22).
found = False
for _ in range(15):
if any(f.id == meta.id for f in kbc.files.list(tags=[facade_tag])):
found = True
break
time.sleep(2)
assert found, "uploaded file must appear in list"

kbc.files.delete(meta.id)
self._created_file_ids.remove(meta.id)
Expand Down Expand Up @@ -2672,16 +2681,23 @@ def _test_file_operations(self) -> None:
self._created_file_ids.append(file_id)
assert file_id > 0

# files (list)
data = self._run_ok(
"storage",
"files",
"--project",
self.alias,
"--tag",
f"e2e-{RUN_ID}",
)
file_ids = [f["id"] for f in data["data"]["files"]]
# files (list) -- the tag index is read-after-write eventually
# consistent; poll until the just-uploaded file appears rather than
# asserting the first list.
file_ids: list[int] = []
for _ in range(15):
data = self._run_ok(
"storage",
"files",
"--project",
self.alias,
"--tag",
f"e2e-{RUN_ID}",
)
file_ids = [f["id"] for f in data["data"]["files"]]
if file_id in file_ids:
break
time.sleep(2)
assert file_id in file_ids

# file-detail
Expand Down