Skip to content

test(e2e): paginate resource lookups - #1127

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

test(e2e): paginate resource lookups#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

@orangeCatDeveloper
NekoPunch (orangeCatDeveloper) force-pushed the fix/e2e-list-pagination branch 2 times, most recently from b80276a to 89b1ad4 Compare August 25, 2026 03:32
@orangeCatDeveloper NekoPunch (orangeCatDeveloper) changed the title e2e: read every page when looking for a resource in a list test(e2e): paginate resource lookups Aug 25, 2026
@orangeCatDeveloper
NekoPunch (orangeCatDeveloper) force-pushed the fix/e2e-list-pagination branch 3 times, most recently from c4efc8c to 8af2b33 Compare August 29, 2026 19:05
@orangeCatDeveloper
NekoPunch (orangeCatDeveloper) force-pushed the fix/e2e-list-pagination branch 2 times, most recently from b7e58ee to d6c08fc Compare September 4, 2026 06:27
A newly created resource is not guaranteed to appear on the first name-ordered page. Read every page before reporting 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