Open colin-stubbs opened 1 month ago
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!
though it seems my assumed solution may not actually work
Ah and I think the reason is because we automatically log tracebacks for warnings and errors:
So passing trace=False
to the logging call should do the trick.
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.