|
13 | 13 | from tests.common.helpers.sad_path import SadOperation
|
14 | 14 | from tests.ptf_runner import ptf_runner
|
15 | 15 | from tests.common.helpers.assertions import pytest_assert
|
| 16 | +from tests.common.utilities import InterruptableThread |
16 | 17 |
|
17 | 18 | logger = logging.getLogger(__name__)
|
18 | 19 |
|
@@ -448,9 +449,21 @@ def runRebootTest(self):
|
448 | 449 | pre_reboot_analysis, post_reboot_analysis = self.advanceboot_loganalyzer
|
449 | 450 | marker = pre_reboot_analysis()
|
450 | 451 | self.__setupRebootOper(rebootOper)
|
451 |
| - result = self.__runPtfRunner(rebootOper) |
| 452 | + thread = InterruptableThread( |
| 453 | + target=self.__runPtfRunner, |
| 454 | + kwargs={"rebootOper": rebootOper}) |
| 455 | + thread.daemon = True |
| 456 | + thread.start() |
| 457 | + # give the test REBOOT_CASE_TIMEOUT (1800s) to complete the reboot with IO, |
| 458 | + # and then additional 300s to examine the pcap, logs and generate reports |
| 459 | + ptf_timeout = REBOOT_CASE_TIMEOUT + 300 |
| 460 | + thread.join(timeout=ptf_timeout, suppress_exception=True) |
| 461 | + self.ptfhost.shell("pkill -f 'ptftests advanced-reboot.ReloadTest'", module_ignore_errors=True) |
| 462 | + # the thread might still be running, and to catch any exceptions after pkill allow 10s to join |
| 463 | + thread.join(timeout=10) |
452 | 464 | self.__verifyRebootOper(rebootOper)
|
453 | 465 | except Exception:
|
| 466 | + logger.error("Exception caught while running advanced-reboot test on ptf") |
454 | 467 | failed_list.append(rebootOper)
|
455 | 468 | finally:
|
456 | 469 | # always capture the test logs
|
|
0 commit comments