Skip to content

Commit 7a04492

Browse files
committed
Apply CI workaround and re-enable ping tests.
Ref actions/runner-images#11614
1 parent 28f53ed commit 7a04492

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ jobs:
6363
run: |
6464
sudo apt update
6565
sudo apt install -y libxml2-dev libxslt-dev
66+
- name: Enable unprivileged ping sockets
67+
# actions/runner-images#11614
68+
if: matrix.platform == 'ubuntu-latest'
69+
shell: bash
70+
run: |
71+
echo 'net.ipv4.ping_group_range = 0 2147483647' | sudo tee -a /etc/sysctl.conf
72+
sudo sysctl -p
6673
- name: Setup Python
6774
uses: actions/setup-python@v4
6875
with:
@@ -85,6 +92,13 @@ jobs:
8592
- uses: actions/checkout@v4
8693
with:
8794
fetch-depth: 0
95+
- name: Enable unprivileged ping sockets
96+
# actions/runner-images#11614
97+
if: matrix.platform == 'ubuntu-latest'
98+
shell: bash
99+
run: |
100+
echo 'net.ipv4.ping_group_range = 0 2147483647' | sudo tee -a /etc/sysctl.conf
101+
sudo sysctl -p
88102
- name: Setup Python
89103
uses: actions/setup-python@v4
90104
with:

conftest.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,6 @@ def old_ping_exception():
2626
return sys.version_info < (3, 10)
2727

2828

29-
def broken_actions_runner():
30-
"""
31-
Is unprivileged ICMP unavailable?
32-
33-
Since Dec 2024, GitHub Actions runners no longer seem
34-
to be able to allow unprivileged ICMP.
35-
36-
actions/runner-images#11614
37-
"""
38-
return bool(os.environ.get('GITHUB_ACTIONS')) and (
39-
# Unfortunately, `os.environ['RUNNER_OS']` doesn't work
40-
platform.system() == 'Linux'
41-
)
42-
43-
4429
collect_ignore = (
4530
[
4631
'jaraco/net/devices/linux.py',
@@ -55,7 +40,7 @@ def broken_actions_runner():
5540
+ [
5641
'jaraco/net/icmp.py',
5742
]
58-
* (old_ping_exception() or broken_actions_runner())
43+
* old_ping_exception()
5944
)
6045

6146

0 commit comments

Comments
 (0)