-
-
Notifications
You must be signed in to change notification settings - Fork 44
Python (code eval) & dependency version upgrades #246
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
Changes from all commits
4f6291e
39620bc
5a7f193
f174f41
d018ee9
dfebd21
ad17dac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
anyio[trio]~=4.9 | ||
anyio[trio]~=4.11 | ||
arrow~=1.3 | ||
attrs~=25.3 | ||
beautifulsoup4~=4.13 | ||
attrs~=25.4 | ||
beautifulsoup4~=4.14 | ||
|
||
# Doesn't support 3.13, 3.13t, nor 3.14-dev, so commented out for now. | ||
# Doesn't support 3.13, 3.14 or 3.14t, so commented out for now. | ||
# einspect~=0.5 | ||
|
||
fishhook~=0.3; python_version == "3.13" | ||
forbiddenfruit~=0.1 | ||
fuzzywuzzy~=0.18 | ||
kaleido~=0.2 | ||
lark~=1.2 | ||
matplotlib~=3.10; python_version == "3.13" | ||
more-itertools~=10.7 | ||
|
||
# Subdependency orjson doesn't currently build correctly on 3.14t, | ||
# but unfortunately there is not currently a way to provide version | ||
# specification that filters based on free-threading capability. | ||
kaleido~=1.1; python_version == "3.13" | ||
lark~=1.3 | ||
matplotlib~=3.10 | ||
more-itertools~=10.8 | ||
networkx~=3.5 | ||
numpy~=2.3 | ||
pandas~=2.3; python_version == "3.13" | ||
pandas~=2.3 | ||
pendulum~=3.1 | ||
pyarrow~=21.0; python_version == "3.13" | ||
python-dateutil~=2.9 | ||
pyyaml~=6.0 | ||
scipy~=1.16 | ||
sympy~=1.14 | ||
typing-extensions~=4.14 | ||
typing-extensions~=4.15 | ||
tzdata~=2025.2 | ||
yarl~=1.20 | ||
yarl~=1.22 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,17 +108,17 @@ def f(): | |
object = "A" * 40_000_000 | ||
time.sleep(0.5) | ||
|
||
if __name__ == "__main__": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In 3.14, https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods |
||
proc_1 = Process(target=f) | ||
proc_2 = Process(target=f) | ||
|
||
proc_1 = Process(target=f) | ||
proc_2 = Process(target=f) | ||
proc_1.start() | ||
proc_2.start() | ||
|
||
proc_1.start() | ||
proc_2.start() | ||
proc_1.join() | ||
proc_2.join() | ||
|
||
proc_1.join() | ||
proc_2.join() | ||
|
||
print(proc_1.exitcode, proc_2.exitcode) | ||
print(proc_1.exitcode, proc_2.exitcode) | ||
""" | ||
) | ||
|
||
|
@@ -137,8 +137,9 @@ def test_multiprocessing_pool(self): | |
def f(x): | ||
return x*x | ||
|
||
with Pool(2) as p: | ||
print(p.map(f, [1, 2, 3])) | ||
if __name__ == "__main__": | ||
with Pool(2) as p: | ||
print(p.map(f, [1, 2, 3])) | ||
""" | ||
) | ||
|
||
|
@@ -212,6 +213,13 @@ def test_write_hidden_exclude(self): | |
self.assertEqual(result.files[0].content, b"a") | ||
|
||
def test_forkbomb_resource_unavailable(self): | ||
# Using the production max PIDs causes processes to be killed due to memory instead of | ||
# PID allocation exhaustion. For this test case, the PID limit is reduced to ensure | ||
# that PID exhaustion is still something that is guarded against. | ||
|
||
previous_pids_max = self.nsjail.config.cgroup_pids_max | ||
self.nsjail.config.cgroup_pids_max = 5 | ||
|
||
code = dedent( | ||
""" | ||
import os | ||
|
@@ -220,10 +228,13 @@ def test_forkbomb_resource_unavailable(self): | |
""" | ||
).strip() | ||
|
||
result = self.eval_file(code) | ||
self.assertEqual(result.returncode, 1) | ||
self.assertIn("Resource temporarily unavailable", result.stdout) | ||
self.assertEqual(result.stderr, None) | ||
try: | ||
result = self.eval_file(code) | ||
self.assertEqual(result.returncode, 1) | ||
self.assertIn("Resource temporarily unavailable", result.stdout) | ||
self.assertEqual(result.stderr, None) | ||
finally: | ||
self.nsjail.config.cgroup_pids_max = previous_pids_max | ||
|
||
def test_file_parsing_timeout(self): | ||
code = dedent( | ||
|
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 the increase?
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.
Never mind I read the commit message