Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing DAP tests on Github Actions #116

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

agarciadom
Copy link
Contributor

This is a work-in-progress PR for debugging the DAP test failures on Github actions. Please do not merge for now.

@agarciadom agarciadom marked this pull request as draft September 2, 2024 11:57
When running tests from Github Actions, there was a race condition between the
code handling the "stopped" message and the code that was trying to continue the
execution after the end of the test. Sometimes, the test would try to release the
"suspendLatch" before it was set, which would result in the "continue" request
effectively being ignored by the debug adapter.

This commit extends the synchronized block in the suspend() method so any code
trying to call resumeAllThreads() while reacting to the "stopped" message will
have to wait until the suspendLatch has been enabled and the execution of the
Epsilon script has been suspended by having the Thread wait().
@agarciadom agarciadom changed the title WIP: Add some debugging code Fix failing DAP tests on Github Actions Sep 2, 2024
@agarciadom agarciadom marked this pull request as ready for review September 2, 2024 15:28
@agarciadom
Copy link
Contributor Author

Turns out that Github Actions did catch a mistake in our DAP code! The synchronized block in the suspend() method did not cover the sending of the stopped message, so there was a race condition between the rest of the method (which sets the latch to true and waits on it to be set to false) and the code responding to the stopped message being sent by the adapter. In Github Actions, this meant that sometimes resumeAllThreads() was running before the suspendLatch was set to true, meaning that the continue request from the test was being thrown away.

This now passes on Github Actions as well :-).

@agarciadom agarciadom merged commit 700bae2 into main Sep 2, 2024
2 checks passed
@agarciadom agarciadom added the bug Something isn't working label Sep 2, 2024
@agarciadom agarciadom added this to the 2.6.0 milestone Sep 2, 2024
@agarciadom agarciadom self-assigned this Sep 2, 2024
@agarciadom agarciadom deleted the debug-dap-failures branch September 2, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant