Skip to content

Commit a1e4f7c

Browse files
test(worker): scope Linux isolation and deadline acceptance checks
1 parent 74778be commit a1e4f7c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test_external_boundary.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import socket
99
import socketserver
1010
import subprocess
11+
import sys
1112
import threading
1213
import time
1314
import unittest
@@ -316,6 +317,10 @@ def test_malformed_kind_is_a_refusal_not_an_exception(self):
316317

317318

318319
class DNSAndTLSBoundaryTests(unittest.TestCase):
320+
# The worker's runner/scanner refuse non-Linux execution. These exercise
321+
# its clean resolver environment and POSIX process/descriptor lifecycle,
322+
# unlike the portable pure admission, TLS metadata and budget tests below.
323+
@unittest.skipUnless(sys.platform.startswith("linux"), "Linux worker resolver process isolation")
319324
def test_dns_timeout_kills_and_reaps_the_helper(self):
320325
processes = []
321326
real_popen = subprocess.Popen
@@ -334,6 +339,7 @@ def start(*args, **kwargs):
334339
with self.assertRaises(ChildProcessError):
335340
os.waitpid(processes[0].pid, os.WNOHANG)
336341

342+
@unittest.skipUnless(sys.platform.startswith("linux"), "Linux worker resolver process isolation")
337343
def test_dns_helper_gets_no_parent_secrets_or_inherited_channel(self):
338344
read_fd, write_fd = os.pipe()
339345
self.addCleanup(os.close, read_fd)
@@ -429,6 +435,10 @@ def connect(connection, deadline):
429435
return raw
430436
return connect
431437

438+
# Cross-thread shutdown of a duplicated socket enforces the Linux worker's
439+
# hard deadline. Preserve its strict bound on the supported runtime rather
440+
# than relaxing it to cover Windows socket cancellation behavior.
441+
@unittest.skipUnless(sys.platform.startswith("linux"), "Linux worker hard socket deadline")
432442
def test_body_deadline_survives_connection_sock_handoff(self):
433443
transport = opener()
434444
started = time.monotonic()
@@ -441,6 +451,7 @@ def test_body_deadline_survives_connection_sock_handoff(self):
441451
self.assertLess(time.monotonic() - started, 0.8)
442452
self.assertFalse(transport.meter.inflight)
443453

454+
@unittest.skipUnless(sys.platform.startswith("linux"), "Linux worker hard socket deadline")
444455
def test_slow_header_has_total_not_inactivity_deadline(self):
445456
transport = opener()
446457
started = time.monotonic()

0 commit comments

Comments
 (0)