Skip to content

Commit

Permalink
Disable long test timeouts when using a debugger
Browse files Browse the repository at this point in the history
Summary: Adds a logic to disable test timeouts when a debugger is detected.

Reviewed By: mgarrard

Differential Revision: D62244200
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Sep 5, 2024
1 parent 66aed70 commit 84123eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ax/utils/common/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ def signal_handler(signum: int, frame: Optional[FrameType]) -> None:
message += (
" To see a profiler output, set `TestCase.PROFILE_TESTS` to `True`."
)

if self._long_test_active_reason is None:
if hasattr(sys, "gettrace") and sys.gettrace() is not None:
# If we're in a debugger session, let the test continue running.
return
elif self._long_test_active_reason is None:
message += (
" To specify a reason for a long running test,"
+ " utilize the @ax_long_test decorator. If your test "
Expand Down

0 comments on commit 84123eb

Please sign in to comment.