Skip to content

Commit

Permalink
Fix for windows timeout testing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tuncbkose authored and Gehock committed Mar 29, 2023
1 parent 0d41a7e commit 3e8f778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nbgrader/tests/apps/test_nbgrader_autograde.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,8 @@ def test_autograde_timeout(self, db, course_dir):
self._copy_file(join("files", "timeout.ipynb"), join(course_dir, "submitted", "bar", "ps1", "p1.ipynb"))

output = run_nbgrader(["autograde", "ps1", "--db", db, "--student", "foo"])
output = run_nbgrader(["autograde", "ps1", "--db", db, "--student", "bar", "--Execute.timeout=1"])
# timeout=2 secs, 1 was causing an asyncio error on Windows
output = run_nbgrader(["autograde", "ps1", "--db", db, "--student", "bar", "--Execute.timeout=2"])

# Check timeout config changes function based on timeout config
with Gradebook(db) as gb:
Expand Down
3 changes: 2 additions & 1 deletion nbgrader/tests/apps/test_nbgrader_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def test_validate_timeout(self, db, course_dir):
output = run_nbgrader(["validate", "nb1.ipynb"], stdout=True)
assert output.strip() == "Success! Your notebook passes all the tests."

output = run_nbgrader(["validate", "--Execute.timeout=1", "nb1.ipynb"], stdout=True)
# timeout=1 leads to an asyncio error on Windows
output = run_nbgrader(["validate", "--Execute.timeout=2", "nb1.ipynb"], stdout=True)
assert output.splitlines()[-2].strip() == "CellTimeoutError: No reply from kernel before timeout"

0 comments on commit 3e8f778

Please sign in to comment.