Skip to content

Random(?) test_crawler.py failure on Travis #4014

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

Closed
elacuesta opened this issue Sep 13, 2019 · 8 comments · Fixed by #4095
Closed

Random(?) test_crawler.py failure on Travis #4014

elacuesta opened this issue Sep 13, 2019 · 8 comments · Fixed by #4095
Labels

Comments

@elacuesta
Copy link
Member

elacuesta commented Sep 13, 2019

Every now and then the Travis build fails on tests.test_crawler.CrawlerRunnerTestCase.test_deprecated_attribute_spiders, I'm not sure why.
Some examples:

PS: Sorry, I feel bad for ignoring the bug report template, but I felt like it didn't apply in this case.

@s-sanjay
Copy link
Contributor

s-sanjay commented Oct 1, 2019

for some reason github search did not give me any result when I searched test_deprecated_attribute_spiders so I opened the other issue. hoping this comment gets indexed by github

@Gallaecio Gallaecio added the bug label Oct 1, 2019
@elacuesta
Copy link
Member Author

@s-sanjay That's ok, I only included the full path in the description after seeing your issue. Thanks!

@elacuesta
Copy link
Member Author

@s-sanjay
Copy link
Contributor

s-sanjay commented Oct 5, 2019

let me try to run in the same environment using the same HASHSEED

@s-sanjay
Copy link
Contributor

s-sanjay commented Oct 6, 2019

the flakiness is happening due to this

{message : ResourceWarning('unclosed file <_io.BufferedReader name=30>',), category : 'ResourceWarning', filename : '/Users/sanjay/nobackup/scrapy/.tox/py36/lib/python3.6/copy.py', lineno : 239, line : None}
{message : ResourceWarning('unclosed file <_io.BufferedReader name=25>',), category : 'ResourceWarning', filename : '/Users/sanjay/nobackup/scrapy/.tox/py36/lib/python3.6/copy.py', lineno : 239, line : None}
{message : ScrapyDeprecationWarning('CrawlerRunner.spiders attribute is renamed to CrawlerRunner.spider_loader.',), category : 'ScrapyDeprecationWarning', filename : '/Users/sanjay/nobackup/scrapy/tests/test_crawler.py', lineno : 172, line : None}

These warnings ResourceWarning('unclosed file <_io.BufferedReader name=30> are the reason the tests are failing. Every run, the filename is changed and I still have to figure out who is opening these files and everytime it blames deepcopy module.

@Gallaecio
Copy link
Member

Should we use https://pypi.org/project/flaky/ to have these tests re-run a few times if they fail? (discovered through scrapinghub/frontera#379)

@s-sanjay
Copy link
Contributor

@Gallaecio so when tests fail due to some other issue re running them is great but shouldn't we as much as possible prevent flakiness from being introduced.. as a last resort we can re run them but if we re run would it not also delay fixing the reasons for flakiness ?

@Gallaecio
Copy link
Member

@s-sanjay I was suggesting that as a temporary measure, to avoid new contributors from getting hit by this and us having to explain to them that the issue is in Scrapy and not in their changes.

In any case, #4095 should have fixed the actual issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants