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

pyportaltests: work around potential session close timeout failures #168

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

whot
Copy link
Contributor

@whot whot commented Sep 10, 2024

This may or may not fix #166 but ever optimistically we go for the former.

cc @smcv, @GeorgesStavracas

@smcv
Copy link
Contributor

smcv commented Sep 10, 2024

Thanks, I'll try applying this to the packages where I saw #166 and see what happens.

@smcv
Copy link
Contributor

smcv commented Sep 11, 2024

This isn't solving the issue for me. When I run the test in a loop, I'm variously either seeing success, the same failure mode as before, or a segfault inside libportal.

Following up on the segfault is probably the best route, since fixing that might also fix #166.

@smcv
Copy link
Contributor

smcv commented Sep 11, 2024

Following up on the segfault is probably the best route

#169

@smcv smcv marked this pull request as draft September 19, 2024 09:03
@whot
Copy link
Contributor Author

whot commented Oct 9, 2024

Closing based on #168 (comment)

@whot whot closed this Oct 9, 2024
@whot whot reopened this Oct 9, 2024
@whot
Copy link
Contributor Author

whot commented Oct 9, 2024

@smcv I think I got it - this reliably passes on my machine now

@whot
Copy link
Contributor Author

whot commented Oct 10, 2024

Alright, this time it does work. So in the end it was a race condition between when the signal was sent out and when the test registered for the signal. The 500ms simply weren't enough.

Yesterday's patch had a bug - to make it nice python I dropped the result but that had the side-effect of Python cleaning up the XdpSession object (which was only exposed when I rebased on top of 0f8f627). So keeping the session variable alive until the test fixes that particular issue now.

@whot whot marked this pull request as ready for review October 10, 2024 04:23
This works around a race condition where test_close_session_signal
registers a callback but on slow systems the Close signal may be sent
before said callback can be registered.

Note that we need to keep the returned SessionResult alive so the
XdpSession isn't cleaned up by the Python GC before we finish the test.

Closes flatpak#166
@GeorgesStavracas GeorgesStavracas merged commit a885ffe into flatpak:main Oct 23, 2024
15 checks passed
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.

test_close_session_signal intermittently failing
3 participants