This commit is contained in:
parent
6e3123091a
commit
aeddaa6972
69 changed files with 3178 additions and 424 deletions
|
|
@ -27,6 +27,36 @@ runner = load_module()
|
|||
|
||||
|
||||
class PeriodicRunnerStaticContractTests(unittest.TestCase):
|
||||
def test_local_controller_failure_keeps_both_bounded_stream_tails(self) -> None:
|
||||
stdout = "x" * 1300 + "PLAYWRIGHT_ASSERTION"
|
||||
stderr = "y" * 1300 + "NODE_WARNING"
|
||||
completed = runner.subprocess.CompletedProcess(
|
||||
args=["node.exe"],
|
||||
returncode=17,
|
||||
stdout=stdout,
|
||||
stderr=stderr,
|
||||
)
|
||||
|
||||
with patch.object(runner.subprocess, "run", return_value=completed):
|
||||
with self.assertRaises(runner.GateError) as caught:
|
||||
runner.LocalController().run(
|
||||
"periodic_browser",
|
||||
["node.exe", "playwright"],
|
||||
cwd=Path("."),
|
||||
timeout=1,
|
||||
)
|
||||
|
||||
message = runner._safe_error(caught.exception)
|
||||
self.assertIn("stdout tail:\n", message)
|
||||
self.assertIn("stderr tail:\n", message)
|
||||
self.assertIn("PLAYWRIGHT_ASSERTION", message)
|
||||
self.assertIn("NODE_WARNING", message)
|
||||
stdout_tail, stderr_tail = message.split("stdout tail:\n", 1)[1].split(
|
||||
"\nstderr tail:\n", 1
|
||||
)
|
||||
self.assertLessEqual(len(stdout_tail), 600)
|
||||
self.assertLessEqual(len(stderr_tail), 600)
|
||||
|
||||
def test_browser_failures_are_not_retried_automatically(self) -> None:
|
||||
self.assertEqual(runner.PLAYWRIGHT_RETRIES, 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue