[CI] Batch CPU test workers (#37252)
This commit is contained in:
@@ -54,14 +54,28 @@ class TestForkTestWorker(CustomTestCase):
|
||||
assert "SGLANG_FORK_WORKER_TEST" not in os.environ
|
||||
raise SystemExit(3)
|
||||
"""))
|
||||
helper = Path(tmpdir) / "sibling_helper.py"
|
||||
helper.write_text("VALUE = 42\n")
|
||||
sibling_import = Path(tmpdir) / "sibling_import.py"
|
||||
sibling_import.write_text(textwrap.dedent("""
|
||||
import os
|
||||
import sys
|
||||
|
||||
from sibling_helper import VALUE
|
||||
|
||||
assert sys.path[0] == os.path.dirname(__file__)
|
||||
assert VALUE == 42
|
||||
"""))
|
||||
|
||||
results = []
|
||||
for filename in (first, second):
|
||||
for filename in (first, second, sibling_import):
|
||||
process.stdin.write(json.dumps({"filename": str(filename)}) + "\n")
|
||||
process.stdin.flush()
|
||||
results.append(json.loads(result_stream.readline()))
|
||||
|
||||
self.assertEqual([result["returncode"] for result in results], [0, 3])
|
||||
self.assertEqual(
|
||||
[result["returncode"] for result in results], [0, 3, 0]
|
||||
)
|
||||
self.assertTrue(all(result["elapsed"] >= 0 for result in results))
|
||||
|
||||
process.stdin.write(json.dumps({"command": "stop"}) + "\n")
|
||||
|
||||
Reference in New Issue
Block a user