Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable
faulthandler
right before hard exit of the Java VM.
Without this, when running the test suite via pyTest on Windows, we often, or at least occasionally, get `Windows fatal exception: access violation` errors during the `cleanup()` routine. We already disable the fault-handler at client start-up, on Windows only, but pyTest re-enables it as soon as the exit sequence starts. None of this is really critical, like it doesn't even affect the coverage report, but it is still a red flag. Disabling the fault-handler once more right before shutdown seems to get rid of these spurious crashes entirely. Though that's only true for Windows. On Linux, this change is definitely not a cure-all. Even with it, there are still errors. The error message is different, `Fatal Python error: Segmentation fault`, but similar. It occurs, more specifically, after `client.disconnect()` was called from `session.cleanup()` in runs of `test_node.py` and `test_model.py`. It doesn't seem to help to leave the fault-handler on, like we do at client start-up. It also doesn't help to turn the fault-handler off right from the start, like we do on Windows. In fact, the latter makes it worse, to the extent that Java would then produce fatal error logs dumped to `hs_err_pid*.log` files. So whether this is good or bad remains to be seen, and may have to be re-evaluated by testing at a later date. But at this point, it doesn't seem to hurt to disable the fault-handler, seeing as how only pyTest ever meddles with it, and the change is therefore very unlikely to affect application code in any way, on any platform.
- Loading branch information