Skip to content

Commit

Permalink
Use lower timeout for file parsing timeout test
Browse files Browse the repository at this point in the history
Updating to Bookworm may have increased performance of the file
processing. In any case, this test started failing intermittently on
when running on a local machine. Lower the timeout so even fast
machines will hit the timeout.
  • Loading branch information
MarkKoz committed Sep 16, 2023
1 parent 4d299c1 commit 64e9ab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_nsjail.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_file_parsing_timeout(self):
size = 32 * 1024 * 1024
with open("file", "w") as f:
for _ in range((size // 1024) - 5):
for _ in range(size // 1024):
f.write(data)
for i in range(100):
Expand All @@ -242,7 +242,7 @@ def test_file_parsing_timeout(self):
).strip()
# A value higher than the actual memory needed is used to avoid the limit
# on total file size being reached before the timeout when reading.
nsjail = NsJail(memfs_instance_size=512 * Size.MiB, files_timeout=1)
nsjail = NsJail(memfs_instance_size=128 * Size.MiB, files_timeout=0.1)
result = nsjail.python3(["-c", code])
self.assertEqual(result.returncode, None)
self.assertEqual(
Expand Down

0 comments on commit 64e9ab5

Please sign in to comment.