mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
f38dbfca544cf0ff8f32c11ff101ea2273447842
Right now, this was badly needed for the wayland subtest, as it seems like waiting for a frame to be ready wasn't enough for the screenshot to show what we want. In practice, even if the machine was idle, it could sometimes take a few extra milliseconds for the app to first appear on the display. This was worse when the machine is under stress, which is often the case with CI. For example, the command below showed a ~20% failure rate on my laptop with four cores: go test -c -o test && stress ./test -test.run EndToEnd/Wayland Add a generic withRetries helper function, which allows us to keep trying some action up to a timeout, with sleeps in between that start at 100ms and keep doubling until 2s. The function also logs before each sleep, in case the user is confused why their test is stuck for potentially may seconds at once. Refactor the wantColors function into a separate function that returns an error, as we can no longer directly report errors via *testing.T. It still reports all the mismatches at once, which is useful. It can now be used on to pof withRetries with a thin wrapper. While at it, make the X11 subtest use withRetries to wait for the X server to be ready. It was using a simpler method with a fixed number of static sleeps. It's now more consistent, and a bit better overall. With the changes above, the 'stress' command from earlier can get past 100 runs on my laptop with no failures at all. Finally, fix a rogue log.Fatal call I had somehow missed. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Gio
Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly (experimental). See gioui.org for details and documentation.
Issues
File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/gio@todo.sr.ht. For general discussion, use the mailing list: ~eliasnaur/gio@lists.sr.ht.
Contributing
Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.
See the contribution guide for more details.
Description
Languages
Go
89.6%
C
7%
Java
1.7%
Objective-C
1.6%