Closed lhole closed 1 year ago
@lhole Nice catch. Thanks for finding this. I can ship a fix for this in a new release in the next hour or so.
This was fixed in 4.13.3
- https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.13.3
(was just uploaded to PyPI)
When running tests with pytest in our CI with the dashboard options enabled, we often receive an INTERNALERROR. I think the relevant part of the stack trace is:
Looking at the code, it seems like there's a race condition where the existence of the directory is checked before actually doing the write. I assume that because there are multiple processes contending, two of them can check whether the directory exists and both find it doesn't, then the one process would be able to create the dir and the other wouldn't. I think the solution is to just add
exist_ok=True
to theos.makedirs
call.It looks like you've already added that protection in
patcher.py
. I also see that there are a bunch of places in the code callingos.makedirs
without it specified. I can submit a PR for just the line causing the problem but I'll need some guidance as to whether it should be applied everywhere or not.Full stack trace: