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

Window positoning/sizing tests failed on Ubuntu #447

Closed
lread opened this issue May 26, 2022 · 10 comments · Fixed by #508
Closed

Window positoning/sizing tests failed on Ubuntu #447

lread opened this issue May 26, 2022 · 10 comments · Fixed by #508
Labels

Comments

@lread
Copy link
Collaborator

lread commented May 26, 2022

Symptom

@daveyarwood reported the following failures:

=== test-window-position [jvm][firefox]

FAIL in (test-window-position) (api_test.clj:412)
firefox
expected: (not= x x')
  actual: (not (not= 960 960))

FAIL in (test-window-position) (api_test.clj:413)
firefox
expected: (not= y y')
  actual: (not (not= 0 0))
=== test-window-position [jvm][chrome]

FAIL in (test-window-position) (api_test.clj:412)
chrome
expected: (not= x x')
  actual: (not (not= 961 961))

FAIL in (test-window-position) (api_test.clj:413)
chrome
expected: (not= y y')
  actual: (not (not= 1 1))

Environment

$ bb tools-versions

[ TASK tools-versions  ]---------------------------------------------------------
|-------------------+-----------------------------------------------------------------------------------------------------+---------------------------------|
|        Name       |                                               Version                                               |               Path              |
|-------------------+-----------------------------------------------------------------------------------------------------+---------------------------------|
| Java              | openjdk version "17.0.3" 2022-04-19                                                                 | /home/dave/.jenv/shims/java     |
|                   | OpenJDK Runtime Environment (build 17.0.3+7-Ubuntu-0ubuntu0.20.04.1)                                |                                 |
|                   | OpenJDK 64-Bit Server VM (build 17.0.3+7-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)              |                                 |
| Babashka          | babashka v0.8.2                                                                                     | /home/dave/bin/bb               |
| Image Magick      | Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org                          | /usr/bin/identify               |
| Chrome            | Google Chrome 102.0.5005.61                                                                         | /usr/bin/google-chrome          |
| Chrome Webdriver  | ChromeDriver 101.0.4951.41 (93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}) | /home/dave/npm/bin/chromedriver |
| Firefox           | Mozilla Firefox 100.0.2                                                                             | /usr/bin/firefox                |
| Firefox Webdriver | geckodriver 0.30.0                                                                                  | /usr/bin/geckodriver            |
|-------------------+-----------------------------------------------------------------------------------------------------+---------------------------------|

TASK tools-versions done.
@lread
Copy link
Collaborator Author

lread commented Jun 22, 2022

Heya @daveyarwood, do you still have access to that Linux box?

if so, can you run the following (or equivalent) for me?:

xdpyinfo | grep 'dimensions:'

For me on my Linux VM, for example, it spits out:

 dimensions:    2560x1298 pixels (677x343 millimeters)

@lread
Copy link
Collaborator Author

lread commented Jun 22, 2022

Marked as bug... might be just a bug in our tests though.

@daveyarwood
Copy link
Contributor

For me, that command returns:

  dimensions:    1920x1080 pixels (506x285 millimeters)

@lread
Copy link
Collaborator Author

lread commented Jun 23, 2022

Thanks @daveyarwood, that helps. I've not been able to reproduce this one yet!

@lread
Copy link
Collaborator Author

lread commented Jul 6, 2022

I can't seem to repro this one.
If anyone can describe a reproducible scenario am happy to re-open and have a look.

@lread lread closed this as completed Jul 6, 2022
@lread lread reopened this Oct 21, 2022
@lread
Copy link
Collaborator Author

lread commented Oct 21, 2022

I'm seeing very similar to this on ubuntu CI for bb and jvm api tests.

FAIL in (test-window-position) (/home/runner/work/etaoin/etaoin/test/etaoin/api_test.clj:403)
firefox
expected: (not= x x')
  actual: (not (not= 0 0))

FAIL in (test-window-position) (/home/runner/work/etaoin/etaoin/test/etaoin/api_test.clj:403)
firefox
expected: (not= y y')
  actual: (not (not= 0 0))

@lread lread changed the title Window positoning/sizing tests failed on Ubuntu during local testing Window positoning/sizing tests failed on Ubuntu Oct 21, 2022
@lread
Copy link
Collaborator Author

lread commented Nov 29, 2022

Still occurring on CI as of 29-Nov-2022:

TASK tools-versions  ]---------------------------------------------------------
|-------------------+-----------------------------------------------------------------------------------------------------+----------------------------------------------------------------------|
|        Name       |                                               Version                                               |                                 Path                                 |
|-------------------+-----------------------------------------------------------------------------------------------------+----------------------------------------------------------------------|
| Java              | openjdk version "11.0.17" 2022-10-18                                                                | /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.17-8/x64/bin/java |
|                   | OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)                                     |                                                                      |
|                   | OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)                            |                                                                      |
| Babashka          | babashka v1.0.166                                                                                   | /home/runner/work/_temp/542f713c-4364-4f52-b2a4-943e8e0e76c0/bb      |
| Image Magick      | Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org/                          | /usr/bin/identify                                                    |
| Chrome            | Google Chrome 107.0.5304.121                                                                        | /usr/bin/google-chrome                                               |
| Chrome Webdriver  | ChromeDriver 107.0.5304.62 (1eec40d3a5764881c92085aaee66d25075c159aa-refs/branch-heads/5304@{#942}) | /usr/bin/chromedriver                                                |
| Firefox           | Mozilla Firefox 107.0                                                                               | /usr/bin/firefox                                                     |
| Firefox Webdriver | geckodriver 0.32.0 (4563dd583110 2022-10-13 09:22 +0000)                                            | /usr/bin/geckodriver                                                 |
|-------------------+-----------------------------------------------------------------------------------------------------+----------------------------------------------------------------------|

@lread
Copy link
Collaborator Author

lread commented Nov 29, 2022

This geckodriver issue might be related. The timeframe seems about right for our CI issue.

Maybe we just need to install something called "Fluxbox" on CI.
I'll re-read and experiment.

@lread
Copy link
Collaborator Author

lread commented Nov 29, 2022

Yeah, I can reproduce the CI issue with Etaoin's Dockerfile.

If I install and launch fluxbox, window positioning seems to work.

Setup

bb docker-build

Then

bb docker-run

Then within docker image session, some extra setup:

apt-get install -y rlwrap
export DISPLAY=:99.0
curl -O https://download.clojure.org/install/linux-install-1.11.1.1200.sh
chmod +x linux-install-1.11.1.1200.sh
./linux-install-1.11.1.1200.sh

Start Xvfb

Xvfb :99 -screen 0 1024x768x24 &

Repro of issue

$ bb dev
nREPL server started on port 41877 on host localhost - nrepl://localhost:41877
nREPL 0.9.0
Clojure 1.9.0
OpenJDK 64-Bit Server VM 1.8.0_352-b08
Interrupt: Control+C
Exit:      Control+D or (exit) or (quit)
user=> (require '[etaoin.api :as e])
nil
user=> (def d (e/firefox))
#'user/d
user=> (e/get-window-position d)
{:x 0, :y 0}
user=> (e/set-window-position d {:x 3 :y 4})
{:value {:x 0, :y 0, :width 921, :height 691}}
user=> (e/get-window-position d)
{:x 0, :y 0}

Notice that there are no errors returned but also that x and y remain, incorrectly, 0.

Testing fluxbox

Quit the REPL and get back to the docker shell prompt:

apt-get install -y fluxbox
fluxbox -display :99 &

Then repeat the REPL test from above:

$ bb dev
nREPL server started on port 37003 on host localhost - nrepl://localhost:37003
nREPL 0.9.0
Clojure 1.9.0
OpenJDK 64-Bit Server VM 1.8.0_352-b08
Interrupt: Control+C
Exit:      Control+D or (exit) or (quit)
user=> (require '[etaoin.api :as e])
nil
user=> (def d (e/firefox))
#'user/d
user=> (e/get-window-position d)
{:x 0, :y 0}
user=> (e/set-window-position d {:x 3 :y 4})
{:value {:x 3, :y 4, :width 921, :height 671}}
user=> (e/get-window-position d)
{:x 3, :y 4}

Seems like x and y are now updating appropriately.

@lread
Copy link
Collaborator Author

lread commented Nov 29, 2022

Summary of my understanding:

Firefox's geckodriver stopped compensating for an X windows manager feature that Xvfb does not provide. Hence the failure. Fluxbox fills in the missing windows manager piece.

Notes:

  • Xvfb acts as a virtual X display, and is often used on headless CI servers.
  • Fluxbox is lightweight X windows manager.

lread added a commit to lread/etaoin that referenced this issue Nov 30, 2022
Geckodriver stopped compensating in the absence of a windows manager on Linux.

Xvfb, our virtual display tech on Linux, does not include a windows manager.

We compensate with the fluxbox windows manager.

Also:
- while testing fluxbox, updated our Dockerfile to use clojure docker
image. The clojure docker images are well maintained and, awesomely,
include clojure.

Closes clj-commons#447
lread added a commit that referenced this issue Nov 30, 2022
Geckodriver stopped compensating in the absence of a windows manager on Linux.

Xvfb, our virtual display tech on Linux, does not include a windows manager.

We compensate with the fluxbox windows manager.

Also:
- while testing fluxbox, updated our Dockerfile to use clojure docker
image. The clojure docker images are well maintained and, awesomely,
include clojure.

Closes #447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants