Skip to content

e2e: read every page when looking for a resource in a list - #1127

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:fix/e2e-list-pagination
Open

e2e: read every page when looking for a resource in a list#1127
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:fix/e2e-list-pagination

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

Fixes #1126

TestActorSnapshotLifecycle reports snapshot %q missing from ListActorSnapshots on a cluster that has been up a while, even though the snapshot exists — GetActorSnapshot succeeds on it one line earlier.

The test called ListActorSnapshots once and treated the first page as the whole list. Lists are name-ordered, so a snapshot created just now lands wherever its name sorts: on the cluster where this reproduced it was 1408th of 1518, against a page size of 1000. createActor read ListActors the same way.

Both now drain the pages through one generic helper. Nothing about the product changes; the assertion just looks at the whole list it always meant to.

CI does not hit this — every run gets a fresh cluster and the demo atespace stays well under one page — so the paging path will not be exercised there either. It bites long-lived and shared clusters, and it cost time during the #1050 investigation by looking like a real snapshot loss.

Measured on the cluster where it reproduced, and re-run locally after a rebase onto current main:

before:  15/35 runs failed
after:    0/35 runs failed
Fisher one-sided p = 4.5e-6

$ bash hack/run-e2e-kind.sh -v -args --no-color --test.run TestActorSnapshotLifecycle
--- PASS: TestActorSnapshotLifecycle (5.53s)
ok  github.com/agent-substrate/substrate/internal/e2e/suites/demo	6.184s

Lists are name-ordered, so a resource created just now is not necessarily
on the first page, and treating that page as the whole list reports it
missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestActorSnapshotLifecycle reads only the first page of ListActorSnapshots

1 participant