-
Notifications
You must be signed in to change notification settings - Fork 366
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
RuntimeError: context has already been set #1385
Comments
Thanks for noticing this. Would you care to make a quick PR? |
Shall do, I've already started testing it... though it seems my assumed solution may not actually work, I'm not sure why as yet. Possibly python versioning. I've got a few other things that I'll wind up logging as bugs too, before logging some feature requests with corresponding PR's for the modules I've been building. As feedback... the bbot doco is generally great! Fantastic even. The hardest part for someone new to the code base is actually understanding the testing process, e.g. how to write test modules and how the various pytest driven bits'n'bobs all hang together. This whole multiprocessing spawn thing was a non-event side track from trying to understand why aspects to testing were failing :-( Some sort of guide to "Module Testing" in the developer docs would be great to be able to refer to. |
This is good feedback for the developer docs; you might be one of the first to read it so I'm glad you're noticing this stuff. Excited to see what modules you're working on! |
Describe the bug
When running tests confusing errors are produced due to an exception raised by the testing process, whereby bbot Scanner objects are reused and on subsequent usage python multiprocessing method 'spawn' is attempted again, when it has already been set to 'spawn'.
This may also occur in other situations where Scanner objects are created and reused for valid reasons.
This is due to this code inside
__init__()
for the Scanner class from ./bbot/scanner/scanner.pyThis appears to be trivially resolved by adding an if statement based on the return value of mp.get_start_method(),
e.g.
No more errors.
Expected behavior
No errors, no exceptions.
BBOT Command
./bbot/test/run_tests.sh
OS, BBOT Installation Method + Version
Not relevant, using latest code from git main branch.
BBOT Config
Not relevant, using latest code from git main branch.
Logs
Screenshots
Not relevant.
The text was updated successfully, but these errors were encountered: