diff --git a/tools/aurora-sep/tests/test_m3_max.py b/tools/aurora-sep/tests/test_m3_max.py index 7dc7cd998279f..c242c71a9e20e 100644 --- a/tools/aurora-sep/tests/test_m3_max.py +++ b/tools/aurora-sep/tests/test_m3_max.py @@ -1169,8 +1169,17 @@ def test_ctrl_c_stops_the_load(self): self.max_mac("j514c", backlight=True) p = self.popen("M3_SURVEY_PHASE_S=10\n") self.wait_for(lambda: len(self.loads()) >= 16, "the load") - os.killpg(p.pid, signal.SIGINT) - out, err = p.communicate(timeout=30) + # Under load bash sometimes drops one SIGINT and the survey runs to the end (exit 0). A user + # presses Ctrl-C again, so send it again. + for _ in range(4): + os.killpg(p.pid, signal.SIGINT) + try: + out, err = p.communicate(timeout=2) + break + except subprocess.TimeoutExpired: + pass + else: + out, err = p.communicate(timeout=30) self.assertEqual(p.returncode, 130, err) self.assertIn("interrupted: the load is stopped", err) self.assertEqual(list(self.out.iterdir()), [])