Skip to content

Conversation

JDevlieghere
Copy link
Member

Various DAP tests are specifying their own timeouts, with values ranging from "1" to "20". Most of them seem arbitrary, but some come with a comment.

The performance characters of running these tests in CI are unpredictable (they generally run much slower than developers expect) and really not something we can make assumptions about. I suspect these timeouts are a contributing factor to the flakiness of the DAP tests.

This PR unifies the timeouts around a central value in the DAP server.

Fixes #162523

Various DAP tests are specifying their own timeouts, with values ranging
from "1" to "20". Most of them seem arbitrary, but some come with a
comment.

The performance characters of running these tests in CI are
unpredictable (they generally run much slower than developers expect)
and really not something we can make assumptions about. I suspect these
timeouts are a contributing factor to the flakiness of the DAP tests.

This PR unifies the timeouts around a central value in the DAP server.

Fixes llvm#162523
@JDevlieghere JDevlieghere requested a review from ashgti October 13, 2025 23:51
@JDevlieghere
Copy link
Member Author

Draft because this breaks TestDAP_attach.py because the test sleeps for 10 seconds and it relied on modifying the timeout to account for that.

printf("pid = %i\n", getpid());
#ifdef _WIN32
Sleep(10 * 1000);
Sleep(1 * 1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sleep and sleep on line 27 are now two different durations (1s vs 10s).


# Flush the breakpoint events.
self.dap_server.wait_for_breakpoint_events(timeout=5)
self.dap_server.wait_for_breakpoint_events()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this waits for the full 10s for this to resolve.

Should we look into refactoring this test to not require a 10s wait? E.g. if we know the id of the breakpoints were interested in, then we can wait for those specifically and return once they've resolved.


# Make sure we do not send another event
event = self.dap_server.wait_for_event(["module"], 3)
event = self.dap_server.wait_for_event(["module"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a negative assertion, we're going to wait for the full 10s.

Maybe we need to refactor this test to move away from a negative assertion...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify the timeouts for the DAP tests

2 participants