Full coverage#4019
Conversation
7da3025 to
5250359
Compare
| if not path.exists(): | ||
| suffix = binascii.hexlify(os.urandom(16)).decode("ascii") | ||
| tmpname = path.with_suffix(f"{path.suffix}.{suffix}") | ||
| tmpname.write_bytes(value) |
There was a problem hiding this comment.
I've seen this write_bytes fail occasionally with "file not found" in a pandas runner, here and in other PRs.
I don't know why it happens, or why it seems to happen mostly with pandas, but it looks like silently ignoring IO failures here is in the spirit of things.
| self.failed_normally or self.failed_due_to_deadline | ||
| ): # pragma: no cover # FIXME | ||
| phase = "shrink" | ||
| else: # pragma: no cover # in case of messing with internals |
There was a problem hiding this comment.
Presumably this "messing with internals" is not totally unexpected, otherwise we wouldn't have code to handle it. But I couldn't find any tests or obvious way to enter this method at all without _runner set.
We could consider just dropping this handling, and require that whoever messes also attaches a mock runner?
| # pyodide can't run multiple processes internally, so parallelize explicitly over | ||
| # discovered test files instead (20 at a time) | ||
| TEST_FILES=$(python -m pytest -p no:cacheprovider --setup-plan hypothesis-python/tests/cover | grep ^hypothesis-python/ | cut -d " " -f 1) | ||
| parallel --max-procs 100% --max-args 20 --keep-order --line-buffer \ |
There was a problem hiding this comment.
With all the other tests parallelized through xdist, pyodide was running by itself long after the other tests finish.
This splits the file list to execute batches of N=20 files at a time, in parallel, which brings the total execution time down to the same level as the other tests.
The test output is acceptable IMO, although split into 5-6 separate batches. I was pleasantly surprised by discovering the --keep-order --line-buffer combo, which orders output lines as-if-sequential but still outputs each line as soon as possible.
Fixes #4003
Adds coverage or better-considered coverage exclusions for the earlier FIXMEs.
In the process, one unrelated flake is addressed; plus pyodide CI execution is parallelized.