flatpak / libportal

libportal - Flatpak portal library
https://libportal.org
GNU Lesser General Public License v3.0
82 stars 40 forks source link

pyportaltests: work around potential session close timeout failures #168

Closed whot closed 1 month ago

whot commented 2 months ago

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

cc @smcv, @GeorgesStavracas

smcv commented 2 months ago

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

smcv commented 2 months ago

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 commented 2 months ago

Following up on the segfault is probably the best route

169

whot commented 1 month ago

Closing based on https://github.com/flatpak/libportal/pull/168#issuecomment-2343139942

whot commented 1 month ago

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

whot commented 1 month ago

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 0f8f627dd86b80f380dd6f0a02b11981a7c8a5e1). So keeping the session variable alive until the test fixes that particular issue now.