-
Notifications
You must be signed in to change notification settings - Fork 598
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
Comments
i've double-checked:
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
|
(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) |
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 |
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
|
Seen in #3815
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
)?The text was updated successfully, but these errors were encountered: