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

ci: add unittest execution #436

Merged
merged 1 commit into from
Feb 20, 2025
Merged

ci: add unittest execution #436

merged 1 commit into from
Feb 20, 2025

Conversation

krichprollsch
Copy link
Member

No description provided.

@karlseguin
Copy link
Contributor

I'd like to fix this after refactor CDP is merged. It's a small fix, but it'll just cause a conflict on that PR.

I believe this issue is long-standing and it's the rapid reconnect of the unit test that's bringing it to light.

Client connects, timeout is registered using (&server.timeout_completion), client disconnects. Another client connects before the timeoutCbk is called, another timeout is registered with the same &server.timeout_completion, causing the issue. The fix is that each client needs its own timeout_completion and, on callback, we need to check if the callback completion == current client's completion.

Interestingly, when I added the tests, I noticed that it was really slow (200ms). I traced it back to this issue, but I didn't think through the full implications of re-submitting the same completion. Linux's behavior of crashing makes more sense to me than Mac being slow.

karlseguin added a commit to karlseguin/browser that referenced this pull request Feb 20, 2025
Results in undefined behavior when a client disconnects and another reconnects
while the timeout is being monitored:

lightpanda-io#436 (comment)
@krichprollsch krichprollsch merged commit 09505db into main Feb 20, 2025
9 checks passed
@krichprollsch krichprollsch deleted the ci-unittest branch February 20, 2025 16:45
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants