Failed tests in `tests/test_pr_curve.py`: cannot schedule new futures after interpreter shutdown
See original GitHub issueDescribe the bug
Running pytest
on both the latest tagged version (2.4) and master
results in failed tests in tests/test_pr_curve.py
, specifically test_pr_purve
and test_pr_purve_raw
(test_smoke
runs fine). The error message is RuntimeError: cannot schedule new futures after interpreter shutdown
.
Minimal runnable code to reproduce the behavior
pytest .
in master
tensorboardX checkout.
Expected behavior
All enabled tests succeeding.
There are other tests failing apart of tests/test_pr_curve.py
, BTW (tests/test_lint.py
, tests/test_summary.py
, tests/test_visdom.py
and tests/test_writer.py
) but each failure seems to be a separate issue.
Environment
Reproduced both in docker image for Ubuntu 22.04 and in FHSUserEnv environment on NixOS 21.11 + master
nixpkgs.
pip list|grep -E "torch|proto|tensor"
protobuf 3.15.0
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
torch 1.10.1
torchfile 0.1.0
Python environment
virtualenv 20.10.0
and Python 3.9.9
both on Ubuntu 22.04 and NixOS.
Additional context
The stack trace:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/var/tmp/tensorboardX/tensorboardX/event_file_writer.py", line 69, in flush
self._py_recordio_writer.flush()
File "/var/tmp/tensorboardX/tensorboardX/record_writer.py", line 187, in flush
self._writer.flush()
File "/var/tmp/tensorboardX/tensorboardX/record_writer.py", line 93, in flush
s3.upload_fileobj(upload_buffer, bucket, path)
File "/var/tmp/tensorboardx-env/lib/python3.9/site-packages/boto3/s3/inject.py", line 537, in upload_fileobj
future = manager.upload(
File "/var/tmp/tensorboardx-env/lib/python3.9/site-packages/s3transfer/manager.py", line 326, in upload
return self._submit_transfer(
File "/var/tmp/tensorboardx-env/lib/python3.9/site-packages/s3transfer/manager.py", line 500, in _submit_transfer
self._submission_executor.submit(
File "/var/tmp/tensorboardx-env/lib/python3.9/site-packages/s3transfer/futures.py", line 467, in submit
future = ExecutorFuture(self._executor.submit(task))
File "/nix/store/rppr9s436950i1dlzknbmz40m2xqqnxc-python3-3.9.9/lib/python3.9/concurrent/futures/thread.py", line 169, in submit
raise RuntimeError('cannot schedule new futures after '
RuntimeError: cannot schedule new futures after interpreter shutdown
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
At current
nixpkgs
master branch I cannot reproducetest_pr_curve.py
test failure either, but I do get the same error stack trace after tests finish (not attributed to any test in particular?)After https://github.com/lanpa/tensorboardX/pull/657 is applied, as far as I can see there are no failures anymore - so I think this pull request fixes the issue indeed!
Tests can be fixed like this: https://github.com/lanpa/tensorboardX/issues/651#issuecomment-1003526924