Remove the dead hasattr fallback around the test-only crash counter (#25710)

This commit is contained in:
fzyzcjy
2026-05-19 09:17:40 +08:00
committed by GitHub
parent 0e198f0f4f
commit a740f8de33
@@ -108,8 +108,6 @@ class SchedulerOutputStreamer:
def _trigger_crash_for_tests(self, crash_threshold: int): def _trigger_crash_for_tests(self, crash_threshold: int):
# Crash trigger: crash after stream_output is called N times # Crash trigger: crash after stream_output is called N times
# This is used for testing purposes. # This is used for testing purposes.
if not hasattr(self, "_test_stream_output_count"):
self._test_stream_output_count = 0
self._test_stream_output_count += 1 self._test_stream_output_count += 1
if self._test_stream_output_count >= crash_threshold: if self._test_stream_output_count >= crash_threshold:
raise RuntimeError( raise RuntimeError(