Skip to content

refactor random crate search, the random view size is configurable and we don't retry any more #1260

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

Merged
merged 2 commits into from
Jan 23, 2021

Conversation

syphar
Copy link
Member

@syphar syphar commented Jan 22, 2021

The test-database has not very many test-crates in the id-space which have > 100 github stars, so the random-crate-search for I'm feeling lucky fails in the tests.

This refactors the random crate search so the major factor for its success can be configured.

@syphar syphar changed the title increase iterations for random-crate search so the test doesn't fail refactor random crate search, the random view size is configurable and we don't retry any more Jan 22, 2021
@jyn514 jyn514 added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jan 22, 2021
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Unfortunately, the "feeling lucky" search still occasionally fails.

> i=0; while cargo test lucky; do i=$((i+1)); done
...
thread 'web::releases::tests::im_feeling_lucky_with_stars' panicked at '/releases/search?query=&i-am-feeling-lucky=1: expected redirect to /some_random_crate/1.0.0/some_random_crate/, got 404 Not Found', src/test/mod.rs:80:13
> echo $i
62

But it seems a lot better than before, so I'm ok merging this as a temporary measure.

@syphar
Copy link
Member Author

syphar commented Jan 22, 2021

@jyn514 if nothing serious is blocked because this, give me a little more time today in the evening. I'll figure something out.

Flaky tests annoy the hell out of me when I stumble on them, I don't want to be the reason for them :D

@syphar
Copy link
Member Author

syphar commented Jan 22, 2021

re-adding the retries would help for the tests, but that doesn't feel right.

It's tricky with that kind of test-setup, the frameworks I'm used to currently isolate the data for single test-cases.

After digging into 44f98be I discovered the reason of the problems I had
with this test-case.
@syphar
Copy link
Member Author

syphar commented Jan 22, 2021

After discussion in the channel we came onto the issue with this test, driven by the test-setup in 44f98be and me relying on a relation between data and the primary key sequence.

@jyn514
Copy link
Member

jyn514 commented Jan 23, 2021

I ran this 145 times in a row without issues, nice job :)

@jyn514 jyn514 merged commit 4c80a04 into rust-lang:master Jan 23, 2021
@syphar syphar deleted the fix-lucky-test branch January 23, 2021 18:02
@syphar
Copy link
Member Author

syphar commented Jan 23, 2021

@jyn514 thanks for reviewing and merging!

And sorry that it broke :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants