-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test timeout #779
Add a test timeout #779
Conversation
Thanks for this! Looks like one of the Ray tests is failing. That's not too surprising, I think Ray can be buggy on Windows, we may want to consider just skipping that test on Windows |
db464fe
to
ce1f8c6
Compare
Good point. Added a skipif on the test with the timeout. |
Looks like its timing out in Skipping that test as well would be OK as a hotfix, but if can replicate that test failure via running as SSH can hopefully determine a clean resolution. |
Possibly related: https://discuss.pytorch.org/t/got-stuck-at-tensorboardx-event-file-writer-py/112209 I updated to the newest
Some file is not found:
|
I double checked. The file indeed doesn't exists, the directory exists. So I experiment a bit and found the issue: linux file path limit 4096 It turns out the file length is right on the limit. >>> len("C:\\Users\\circleci.PACKER-64C83029\\AppData\\Local\\Temp\\pytest-of-circleci\\pytest-4\\test_train_preference_comparis0\\train_preference_comparisons\\CartPole-v1\\20231001_144824_a538c8\\log\\events.out.tfevents.1696171705.packer-64c83029-cd75-bf3a-2e04-0f23beb7d9d9.6640.0")
262 So I am checking whether removing the path limit this way can work or not. |
|
so the original error is gone. I noticed two new issues here: Note: #790 can represent the issues for:
And #791 is for:
|
So now the issue is windows platform-wise issue:
|
So it shows a timeout issue saying that Created feature request for this: #793 |
Actually this is solved in stable_baselines3 here, I think we need to set |
Codecov Report
@@ Coverage Diff @@
## master #779 +/- ##
=======================================
Coverage 96.33% 96.33%
=======================================
Files 98 98
Lines 9172 9177 +5
=======================================
+ Hits 8836 8841 +5
Misses 336 336
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these changes! Overall looks almost ready, a few clarifying questions & suggestions, please tag me for a re-review once addressed.
.circleci/config.yml
Outdated
@@ -176,13 +176,28 @@ commands: | |||
.\venv\Scripts\activate | |||
pip install --upgrade --force-reinstall --no-deps . | |||
shell: powershell.exe | |||
|
|||
- run: | |||
name: install gymansium[mujoco] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to explicitly install Gymnasium? Shouldn't this dependency be picked up by pip install .
above?
Also confused why we need the MuJoCo dependency -- do any of our tests use MuJoCo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is directly mentioned in Seals as well. Not quite sure why it shows up only in the Windows environment and only in notebook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some digging here and the TL;DR is that the notebooks were only getting tested on Windows. The SQIL notebook depends on HalfCheetah which is a MuJoCo environment, so it makes sense we'd need thiis dependency. We made a decision a while back to have MuJoCo dependency be optional for the codebase since it's large and can be somewhat tricky to install, so I'm loathe to reverse that especially just special-casing it for the Windows CI run. I'd suggest we instead switch out HalfCheetah for something like MountainCarContinuous
that does not require extra dependencies -- tracking in #798
Note the gym.register
line here should succeed even if MuJoCo is not present -- it will only fail when attempting to instantiate those environments. Indeed,
This doesn't error on unit-test-linux
since we're skipping all notebooks: https://github.com/HumanCompatibleAI/imitation/blob/master/tests/test_examples.py#L43 This was because they were meant to be run in readthedocs after #565 This run is happening but the notebooks failing is just a warning:
/home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/docs/tutorials/8a_train_sqil_sac.ipynb: WARNING: Executing notebook failed: CellExecutionError [mystnb.exec]
/home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/docs/tutorials/8a_train_sqil_sac.ipynb: WARNING: Notebook exception traceback saved in: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/_readthedocs/html/reports/tutorials/8a_train_sqil_sac.err.log [mystnb.exec]
I've opened #799 to track this
Mac we are not running test_examples.py
either due to a separate bug, I'll address in #797
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the detailed explanation! That makes a lot sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The notebooks have a bunch of spurious newlines introduced -- can you please clean up that diff as it will otherwise make commit history/git blame
messy in future.
MuJoCo dependency I think should not be necessary although I now understand (see comment) why test was failing without it -- this has unrooted a deeper problem in our CI that I'll get the team to work on addressing in other PRs/issues.
.circleci/config.yml
Outdated
@@ -176,13 +176,28 @@ commands: | |||
.\venv\Scripts\activate | |||
pip install --upgrade --force-reinstall --no-deps . | |||
shell: powershell.exe | |||
|
|||
- run: | |||
name: install gymansium[mujoco] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some digging here and the TL;DR is that the notebooks were only getting tested on Windows. The SQIL notebook depends on HalfCheetah which is a MuJoCo environment, so it makes sense we'd need thiis dependency. We made a decision a while back to have MuJoCo dependency be optional for the codebase since it's large and can be somewhat tricky to install, so I'm loathe to reverse that especially just special-casing it for the Windows CI run. I'd suggest we instead switch out HalfCheetah for something like MountainCarContinuous
that does not require extra dependencies -- tracking in #798
Note the gym.register
line here should succeed even if MuJoCo is not present -- it will only fail when attempting to instantiate those environments. Indeed,
This doesn't error on unit-test-linux
since we're skipping all notebooks: https://github.com/HumanCompatibleAI/imitation/blob/master/tests/test_examples.py#L43 This was because they were meant to be run in readthedocs after #565 This run is happening but the notebooks failing is just a warning:
/home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/docs/tutorials/8a_train_sqil_sac.ipynb: WARNING: Executing notebook failed: CellExecutionError [mystnb.exec]
/home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/docs/tutorials/8a_train_sqil_sac.ipynb: WARNING: Notebook exception traceback saved in: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/latest/_readthedocs/html/reports/tutorials/8a_train_sqil_sac.err.log [mystnb.exec]
I've opened #799 to track this
Mac we are not running test_examples.py
either due to a separate bug, I'll address in #797
@@ -5,18 +5,17 @@ | |||
"metadata": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newlines seem to have changed throughout this and many other notebooks making the diff messy. Can you clean this up? Most of the notebooks shouldn't be changing in this PR, and I can't tell right now which notebooks had actual semantic changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about this. Yes, I did some semantic changes and then the lint keeps failing on docs/tutorials/4_train_airl.ipynb
. I did something wrong and formatted all notebook. I should have just formatted that only one.
I have reverted the commit and now the notebook change should be easy to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a closer look I see you made some non-trivial changes to the notebooks (not just newlines) and the newlines seem to have been introduced by black reformatting (perhaps a newer version is more opinionated?) so I won't insist on that change.
I'm removing the MuJoCo dependency as that shouldn't be in our CI. This will make it red again but I'll go ahead and merge if the only test that's failing is for 8a_train_sqil_sac
; we should fix that separately in #800 by changing the notebook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Adds timeout of 590 seconds to the tests. This should abort tests before CircleCI interrupts the pipeline thereby allowing us to see which test took so long.
ALSO:
Fix notebook running error. #790 and #779.
Testing
Only test parameter changes.