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

Changed test_fixed_delay(fixes #4268) #4372

Merged
merged 4 commits into from Feb 28, 2020
Merged

Conversation

sakshamb2113
Copy link
Contributor

@sakshamb2113 sakshamb2113 commented Feb 25, 2020

changed delay to 0.11 in test_fixed_delay(). This will greatly reduce any chance of the test failing randomly.

Fixes #4268

@sakshamb2113 sakshamb2113 requested a review from Gallaecio Feb 25, 2020
@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #4372 into master will increase coverage by 0.21%.
The diff coverage is 92.89%.

@@            Coverage Diff             @@
##           master    #4372      +/-   ##
==========================================
+ Coverage   83.94%   84.15%   +0.21%     
==========================================
  Files         165      166       +1     
  Lines        9907     9967      +60     
  Branches     1472     1482      +10     
==========================================
+ Hits         8316     8388      +72     
+ Misses       1336     1324      -12     
  Partials      255      255
Impacted Files Coverage Δ
scrapy/utils/python.py 85.36% <ø> (+5.25%) ⬆️
scrapy/core/engine.py 92.88% <ø> (ø) ⬆️
scrapy/spiderloader.py 100% <ø> (ø) ⬆️
scrapy/utils/console.py 59.67% <ø> (ø) ⬆️
scrapy/utils/request.py 100% <ø> (ø) ⬆️
scrapy/responsetypes.py 94.11% <ø> (ø) ⬆️
scrapy/utils/gz.py 96.87% <ø> (ø) ⬆️
scrapy/core/downloader/tls.py 86.04% <ø> (ø) ⬆️
scrapy/utils/reactor.py 83.33% <0%> (ø) ⬆️
scrapy/commands/parse.py 20.21% <0%> (ø) ⬆️
... and 26 more

@Gallaecio Gallaecio requested a review from wRAR Feb 26, 2020
@wRAR
Copy link
Contributor

wRAR commented Feb 26, 2020

@Gallaecio @sakshamb2113 I didn't try this change yet, but I don't have this problem on every run anyway, so I don't know how to make sure it helps :)

@sakshamb2113
Copy link
Contributor Author

sakshamb2113 commented Feb 26, 2020

@wRAR I wrote a simple bash script to execute the command
tox -e py3 tests/test_crawl.py::CrawlTestCase::test_fixed_delay
for running tests multiple times.

@wRAR
Copy link
Contributor

wRAR commented Feb 26, 2020

I ran the tests with the change and I got the error once. I don't know how many runs would I do to get an approximate error rate, but I'd prefer the error to be fixed completely.

@sakshamb2113
Copy link
Contributor Author

sakshamb2113 commented Feb 26, 2020

@wRAR could you tell me what method did you use to test the function repeatedly ?

@sakshamb2113
Copy link
Contributor Author

sakshamb2113 commented Feb 26, 2020

I have changed delay to 0.2. I have not got any error until now. @wRAR could you please check it ?

@wRAR
Copy link
Contributor

wRAR commented Feb 27, 2020

@wRAR could you tell me what method did you use to test the function repeatedly ?

Just for i in {1..50}; tox -e py35 tests/test_crawl.py::CrawlTestCase::test_fixed_delay and looking for the red lines manually.

@sakshamb2113
Copy link
Contributor Author

sakshamb2113 commented Feb 27, 2020

@wRAR I have run the tests many times with delay=0.2 without any error . I guess there is no case when this value of delay is too small.

@wRAR
Copy link
Contributor

wRAR commented Feb 28, 2020

Looks like it's fine with 0.2 on my machine.

wRAR
wRAR approved these changes Feb 28, 2020
@Gallaecio Gallaecio merged commit c411a51 into scrapy:master Feb 28, 2020
2 checks passed
@sakshamb2113 sakshamb2113 deleted the iss4268 branch Mar 9, 2020
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.

Random failures in CrawlTestCase.test_fixed_delay
3 participants