Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination test is flaky #765

Closed
jagthedrummer opened this issue May 4, 2023 · 2 comments · Fixed by bullet-train-co/bullet_train-core#494
Closed

Pagination test is flaky #765

jagthedrummer opened this issue May 4, 2023 · 2 comments · Fixed by bullet-train-co/bullet_train-core#494

Comments

@jagthedrummer
Copy link
Contributor

For some reason the pagination system test is failing for me in CI, but not locally.

This line is failing for me:

refute page.has_content?("Test #{Pagy::DEFAULT[:items] + 1}")

The page size is 20, so that line is looking for the string "Test 21" in the page content, and is finding it even though it should not be found.

After much head scratching and debugging I finally figured out that for some reason the sort order in CI is backwards. (I have no idea why that might be the case.)

So "Test 21" is actually on the page, but the first item "Test 1" is missing.

But there's actually a test to check for "Test 1" that is passing when it shouldn't pass. And that's because we're doing simple substring matching and "Test 1" also matches "Test 11", "Test 12", etc...

@gazayas
Copy link
Contributor

gazayas commented May 10, 2023

But there's actually a test to check for "Test 1" that is passing when it shouldn't pass. And that's because we're doing simple substring matching and "Test 1" also matches "Test 11", "Test 12", etc...

Good point, I think this would be a better check:

page.text.scan(/Test \d+/).include?("Test 1")

After much head scratching and debugging I finally figured out that for some reason the sort order in CI is backwards. (I have no idea why that might be the case.)

I wonder why it's getting displayed backwards? I'm not sure if this is something on Bullet Train's side.

@jagthedrummer
Copy link
Contributor Author

Probably related to bullet-train-co/bullet_train-core#408

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 a pull request may close this issue.

2 participants