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

Flycky CI for test-focus-bydirection.lua #3849

Open
Elv13 opened this issue Aug 30, 2023 · 4 comments
Open

Flycky CI for test-focus-bydirection.lua #3849

Elv13 opened this issue Aug 30, 2023 · 4 comments

Comments

@Elv13
Copy link
Member

Elv13 commented Aug 30, 2023

Seen in #3815

ests/test-drawable-bgimage.lua ==
== Running /home/runner/work/awesome/awesome/tests/test-focus-bydirection.lua ==
Error: running function for step 1/2 (@2): ...er/work/awesome/awesome/tests/test-focus-bydirection.lua:26: assertion failed!
stack traceback:
	[C]: in function 'assert'
	...er/work/awesome/awesome/tests/test-focus-bydirection.lua:26: in function <...er/work/awesome/awesome/tests/test-focus-bydirection.lua:13>
	[C]: in function 'xpcall'
	/home/runner/work/awesome/awesome/tests/_runner.lua:110: in function </home/runner/work/awesome/awesome/tests/_runner.lua:101>
	[C]: in function 'xpcall'
	lib/gears/protected_call.lua:41: in function 'protected_call'
	lib/gears/timer.lua:280: in function <lib/gears/timer.lua:278>!
NOTE: there were 2 clients left after the test.
===> ERROR running /home/runner/work/awesome/awesome/tests/test-focus-bydirection.lua <===
Error: running function for step 1/2 (@2): ...er/work/awesome/awesome/tests/test-focus-bydirection.lua:26: assertion failed!
== Running /home/runner/work/awesome/awesome/tests/test-focus.lua ==
Error: failed to wait for X clients from previous test to close!
Last reply: .
Log:
Error: running function for step 1/2 (@2): ...er/work/awesome/awesome/tests/test-focus-bydirection.lua:26: assertion failed!
stack traceback:
	[C]: in function 'assert'
	...er/work/awesome/awesome/tests/test-focus-bydirection.lua:26: in function <...er/work/awesome/awesome/tests/test-focus-bydirection.lua:13>
	[C]: in function 'xpcall'
	/home/runner/work/awesome/awesome/tests/_runner.lua:110: in function </home/runner/work/awesome/awesome/tests/_runner.lua:101>
	[C]: in function 'xpcall'
	lib/gears/protected_call.lua:41: in function 'protected_call'
	lib/gears/timer.lua:280: in function <lib/gears/timer.lua:278>!
NOTE: there were 2 clients left after the test.

This need to be investigated. The old travis CI had a awful.placement flacky test which I suspect are caused by the same race condition.

@actionless You said you could reproduce some things on one of your machine. I can't get this to happen, can you (../tests/run.sh ../tests/test-focus-bydirection.lua)?

@actionless
Copy link
Member

i've double-checked:

  1. i have to make these changes to start the tests:
diff --git a/tests/_client.lua b/tests/_client.lua
index 3eb015f31..c0502626f 100644
--- a/tests/_client.lua
+++ b/tests/_client.lua
@@ -13,7 +13,7 @@ local test_client_source = [[
 pcall(require, 'luarocks.loader')
 local lgi  = require 'lgi'
 local GLib = lgi.require('GLib')
-local Gdk  = lgi.require('Gdk')
+local Gdk  = lgi.require('Gdk', '3.0')
 local Gtk  = lgi.require('Gtk', '3.0')
 local Gio  = lgi.require('Gio')
 Gtk.init()
diff --git a/tests/test-geometry.lua b/tests/test-geometry.lua
index f49dbd137..19939b027 100644
--- a/tests/test-geometry.lua
+++ b/tests/test-geometry.lua
@@ -9,6 +9,8 @@ local gdebug = require("gears.debug")
 local test_client = require("_client")
 local lgi = require("lgi")
 local gears = require("gears")
+local Gdk = lgi.require('Gdk', '3.0')
+local GdkX11 = lgi.require('GdkX11', '3.0')
 
 local w = nil
 local w1_draw, w2_draw
@@ -287,7 +289,7 @@ for gravity, expectation in pairs(test_data) do
         function(count)
             if count == 1 then
                 print("testing gravity " .. gravity)
-                test_client(nil,nil,nil,nil,nil,{gravity=lgi.Gdk.Gravity[gravity]})
+                test_client(nil,nil,nil,nil,nil,{gravity=Gdk.Gravity[gravity]})
             else
                 local c = client.get()[1]
                 if c then
@@ -313,8 +315,8 @@ for gravity, expectation in pairs(test_data) do
             return true
         end,
         function()
-            local display = lgi.Gdk.Display.open(os.getenv("DISPLAY"))
-            local window = lgi.GdkX11.X11Window.foreign_new_for_display(display, windowid)
+            local display = Gdk.Display.open(os.getenv("DISPLAY"))
+            local window = GdkX11.X11Window.foreign_new_for_display(display, windowid)
             local x, y, width, height = window:get_geometry()
             print(gravity, x, y, width, height)
             assert(x == expectation[1])
@@ -325,7 +327,7 @@ for gravity, expectation in pairs(test_data) do
             return true
         end,
         function()
-            local display = lgi.Gdk.Display.open(os.getenv("DISPLAY"))
+            local display = Gdk.Display.open(os.getenv("DISPLAY"))
             local window = lgi.GdkX11.X11Window.foreign_new_for_display(display, windowid)
             if window then return end
             return true
@@ -333,7 +335,7 @@ for gravity, expectation in pairs(test_data) do
         -- Additionally, checks our expectations are correct by adding decoration back.
         function(count)
             if count == 1 then
-                test_client(nil,nil,nil,nil,nil,{gravity=lgi.Gdk.Gravity[gravity]})
+                test_client(nil,nil,nil,nil,nil,{gravity=Gdk.Gravity[gravity]})
             else
                 local c = client.get()[1]
                 if c then
diff --git a/tests/test-selection-getter.lua b/tests/test-selection-getter.lua
index afac47034..a62df5c78 100644
--- a/tests/test-selection-getter.lua
+++ b/tests/test-selection-getter.lua
@@ -17,8 +17,9 @@ end
 
 local header = [[
 local lgi = require("lgi")
-local Gdk = lgi.Gdk
-local Gtk = lgi.Gtk
+local Gdk = lgi.require('Gdk', '3.0')
+local Gtk = lgi.require('Gtk', '3.0')
+local Gio = lgi.require('Gio')
 local GLib = lgi.GLib
 local clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
 ]]
diff --git a/tests/test-selection-transfer.lua b/tests/test-selection-transfer.lua
index 52f1df919..0fe052e34 100644
--- a/tests/test-selection-transfer.lua
+++ b/tests/test-selection-transfer.lua
@@ -20,8 +20,8 @@ local large_transfer_size = #large_transfer_piece * large_transfer_piece_count
 
 local header = [[
 local lgi = require("lgi")
-local Gdk = lgi.Gdk
-local Gtk = lgi.Gtk
+local Gdk = lgi.require('Gdk', '3.0')
+local Gtk = lgi.require('Gtk', '3.0')
 local GLib = lgi.GLib
 local function assert_equal(a, b)
     assert(a == b,
diff --git a/tests/test-selection-watcher.lua b/tests/test-selection-watcher.lua
index 2e9d6a647..d0e7ba89b 100644
--- a/tests/test-selection-watcher.lua
+++ b/tests/test-selection-watcher.lua
@@ -12,8 +12,8 @@ end
 
 local header = [[
 local lgi = require("lgi")
-local Gdk = lgi.Gdk
-local Gtk = lgi.Gtk
+local Gdk = lgi.require('Gdk', '3.0')
+local Gtk = lgi.require('Gtk', '3.0')
 local GLib = lgi.GLib
 local clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
 clipboard:set_text("This is an experiment", -1)
diff --git a/tests/test-titlebar.lua b/tests/test-titlebar.lua
index b299b778c..685d2b13f 100644
--- a/tests/test-titlebar.lua
+++ b/tests/test-titlebar.lua
@@ -12,7 +12,7 @@ end
 
 local tiny_client_code_template = [[
 pcall(require, 'luarocks.loader')
-local Gtk, class = require('lgi').require('Gtk'), 'client'
+local Gtk, class = require('lgi').require('Gtk', 3.0), 'client'
 Gtk.init()
 window = Gtk.Window {default_width=100, default_height=100, title='title'}
 %s
  1. although some still failing, not the SUBJ one though 😿
== Running /home/lie/projects/awesome/tests/test-screen-changes.lua ==                                                                                                                                                                                                                     [422/4795]

2023-08-31 02:28:43 W: awesome: a_glib_poll:477: Last main loop iteration took 0.104039 seconds! Increasing limit for this warning to that value.
2023-08-31 02:28:44 W: awesome: a_glib_poll:477: Last main loop iteration took 0.125747 seconds! Increasing limit for this warning to that value.
Error: timeout waiting for signal in step 4/5 (@20) (/home/lie/projects/awesome/tests/test-screen-changes.lua:90).
NOTE: there were 2 clients left after the test.

===> ERROR running /home/lie/projects/awesome/tests/test-screen-changes.lua <===
Error: timeout waiting for signal in step 4/5 (@20) (/home/lie/projects/awesome/tests/test-screen-changes.lua:90).

== Running /home/lie/projects/awesome/tests/test-screenshot.lua ==

2023-08-31 02:28:47 W: awesome: a_glib_poll:477: Last main loop iteration took 0.157543 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-selection-getter.lua ==

2023-08-31 02:28:49 W: awesome: a_glib_poll:477: Last main loop iteration took 0.103637 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-selection-transfer.lua ==

2023-08-31 02:28:51 W: awesome: a_glib_poll:477: Last main loop iteration took 0.109277 seconds! Increasing limit for this warning to that value.
2023-08-31 02:28:51 W: awesome: a_glib_poll:477: Last main loop iteration took 0.273133 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-selection-watcher.lua ==

2023-08-31 02:28:55 W: awesome: a_glib_poll:477: Last main loop iteration took 0.106635 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-signal.lua ==

2023-08-31 02:28:56 W: awesome: a_glib_poll:477: Last main loop iteration took 0.103986 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-spawn.lua ==

Error: timeout waiting for signal in step 3/22 (@20) (/home/lie/projects/awesome/tests/test-spawn.lua:165).

===> ERROR running /home/lie/projects/awesome/tests/test-spawn.lua <===
Error: timeout waiting for signal in step 3/22 (@20) (/home/lie/projects/awesome/tests/test-spawn.lua:165).

== Running /home/lie/projects/awesome/tests/test-spawn-snid.lua ==

== Running /home/lie/projects/awesome/tests/test-struts.lua ==

2023-08-31 02:29:01 W: awesome: a_glib_poll:477: Last main loop iteration took 0.103403 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-systray.lua ==

== Running /home/lie/projects/awesome/tests/test-tag-gap-single-client.lua ==

== Running /home/lie/projects/awesome/tests/test-titlebar.lua ==

/usr/bin/luajit: /usr/share/lua/5.1/lgi/namespace.lua:158: Typelib file for namespace 'Gtk', version '3' not found
stack traceback:
        [C]: in function 'assert'
        /usr/share/lua/5.1/lgi/namespace.lua:158: in function 'require'
        (command line):2: in main chunk
        [C]: at 0x560763979cd0
Error: timeout waiting for signal in step 2/19 (@20) (/home/lie/projects/awesome/tests/test-titlebar.lua:69).

===> ERROR running /home/lie/projects/awesome/tests/test-titlebar.lua <===
Error: timeout waiting for signal in step 2/19 (@20) (/home/lie/projects/awesome/tests/test-titlebar.lua:69).

== Running /home/lie/projects/awesome/tests/test-tooltip.lua ==

2023-08-31 02:29:06 W: awesome: a_glib_poll:477: Last main loop iteration took 0.104010 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-urgent.lua ==

== Running /home/lie/projects/awesome/tests/test-use-after-gc.lua ==

2023-08-31 02:29:08 W: awesome: a_glib_poll:477: Last main loop iteration took 0.104691 seconds! Increasing limit for this warning to that value.
== Running /home/lie/projects/awesome/tests/test-wallpaper.lua ==

== Running /home/lie/projects/awesome/tests/test-wibox-shape.lua ==

56 tests finished.

There were 3 errors:
 - /home/lie/projects/awesome/tests/test-screen-changes.lua: Error: timeout waiting for signal in step 4/5 (@20) (/home/lie/projects/awesome/tests/test-screen-changes.lua:90).
 - /home/lie/projects/awesome/tests/test-spawn.lua: Error: timeout waiting for signal in step 3/22 (@20) (/home/lie/projects/awesome/tests/test-spawn.lua:165).
 - /home/lie/projects/awesome/tests/test-titlebar.lua: Error: timeout waiting for signal in step 2/19 (@20) (/home/lie/projects/awesome/tests/test-titlebar.lua:69).

make[3]: *** [CMakeFiles/check-integration.dir/build.make:71: CMakeFiles/check-integration] Error 1
make[2]: *** [CMakeFiles/Makefile2:29277: CMakeFiles/check-integration.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:29284: CMakeFiles/check-integration.dir/rule] Error 2
make: *** [Makefile:13962: check-integration] Error 2

@actionless
Copy link
Member

(the reason why i changed the order of some imports - because some lgi interfaces depend on gtk, so if not loading gtk first - lgi would load it from the latest version of gtk available, which is 4 now)

@actionless
Copy link
Member

actionless commented Aug 31, 2023

here were 3 errors:

  • /home/lie/projects/awesome/tests/test-screen-changes.lua: Error: timeout waiting for signal in >step 4/5 (@20) (/home/lie/projects/awesome/tests/test-screen-changes.lua:90).
  • /home/lie/projects/awesome/tests/test-spawn.lua: Error: timeout waiting for signal in step 3/22 >(@20) (/home/lie/projects/awesome/tests/test-spawn.lua:165).
  • /home/lie/projects/awesome/tests/test-titlebar.lua: Error: timeout waiting for signal in step 2/19 >(@20) (/home/lie/projects/awesome/tests/test-titlebar.lua:69).

i fixed titlebar by again re-ordering imports a bit

but with spawn situation is very interesting - test actually works, but i had to add to increase the timeout drastically because for some reason it takes 28 seconds for the first client to start up (😯) - and when i run same command outside of the test - it starts instantly

i still suspect it smth to do with lgi and/or gtk versions, looking into it

@actionless
Copy link
Member

actionless commented Aug 31, 2023

nah, i still didn't figured out what's wrong with that spawn test

and here's that patch for fixing titlebar test btw (idk why it matters, mb specific only to luajit, but it wasn't working when was 2 assignments on the same line):

$ git diff tests/test-titlebar.lua
diff --git a/tests/test-titlebar.lua b/tests/test-titlebar.lua
index b299b778c..bf8e21fba 100644
--- a/tests/test-titlebar.lua
+++ b/tests/test-titlebar.lua
@@ -12,7 +12,9 @@ end

 local tiny_client_code_template = [[
 pcall(require, 'luarocks.loader')
-local Gtk, class = require('lgi').require('Gtk'), 'client'
+local lgi = require("lgi")
+local Gtk = lgi.require('Gtk', '3.0')
+local class = "client"
 Gtk.init()
 window = Gtk.Window {default_width=100, default_height=100, title='title'}
 %s

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