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

GtkCanvas and Testset Error #73

Open
nHackel opened this issue Sep 4, 2024 · 2 comments
Open

GtkCanvas and Testset Error #73

nHackel opened this issue Sep 4, 2024 · 2 comments

Comments

@nHackel
Copy link
Contributor

nHackel commented Sep 4, 2024

Hello, we stumbled over an issue with our UI tests after migrating to Gtk4.jl. In the tests we are creating a complex GUI that features multiple GtkCanvases, which we then compare to expected images. With Gtk4.jl these tests fail with the Canvas not being initialized.

I've managed to reduce it to this MWE:

using Gtk4, Test

@testset begin
	c = GtkCanvas()
	win = GtkWindow(c)
	# show(win) # doesn't work with or without show
	getgc(c)
end

I think the tests within Gtk4.jl works somewhat similar (at least they create Canvases within a testset), I'm not sure exactly what I'm missing to get this to work

@jwahlstrand
Copy link
Member

I won't have time to look into this until the weekend, but you could also look at GtkObservables and ImageView, which use GtkCanvas heavily and have extensive tests. I think you need to call sleep. If I recall correctly, recently I had to add more sleep because CI was behaving differently on Mac OS.

@jwahlstrand
Copy link
Member

Adding sleep(1.0) just before the getgc call fixes it for me.

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

No branches or pull requests

2 participants