tlambert03 / setup-qt-libs

install libraries required to use qt on github action (does not install qt itself)
MIT License
17 stars 4 forks source link

Pytestqt: Error: The operation was canceled. #60

Closed hakonhagland closed 1 year ago

hakonhagland commented 1 year ago

Hi I am trying to use this action with pytestqt, but I get the error "Error: The operation was canceled" when the action is run. Here is a minimal example: https://github.com/hakonhagland/pytest-xvfb-test/tree/xvfb2. Here is a link to the workflow I use: https://github.com/hakonhagland/pytest-xvfb-test/blob/xvfb2/.github/workflows/ci.yml, and here is a link to the github action build log: https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882.

Run tlambert03/setup-qt-libs@v1
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.12/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.12/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.12/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.12/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.12/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.12/x64/lib
/usr/bin/sudo apt-get update
Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Get:4 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3611 B]
Get:5 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:8 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [799 kB]
Get:9 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [202 kB]
Get:10 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [15.4 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [580 kB]
Get:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [90.8 kB]
Get:13 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [946 kB]
Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [204 kB]
Get:15 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [20.7 kB]
Get:16 http://azure.archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [9704 B]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:18 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
Get:19 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [16.7 kB]
Get:20 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main all Packages [970 B]
Get:21 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [78.1 kB]
Get:22 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [8411 B]
Get:23 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [579 kB]
Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [142 kB]
Get:25 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.0 kB]
Get:26 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [568 kB]
Get:27 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [89.0 kB]
Get:28 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [751 kB]
Get:29 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe Translation-en [134 kB]
Get:30 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [15.8 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1395 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy/main Translation-en [510 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [129 kB]
Get:35 http://archive.ubuntu.com/ubuntu jammy/restricted Translation-en [18.6 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 c-n-f Metadata [488 B]
Get:37 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [799 kB]
Get:38 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [579 kB]
Get:39 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [202 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [15.4 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [580 kB]
Get:42 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [142 kB]
Get:43 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [90.8 kB]
Get:44 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [528 B]
Get:45 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.0 kB]
Get:46 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [568 kB]
Get:47 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [89.0 kB]
Get:48 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [[53](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:53)2 B]
Get:49 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [751 kB]
Get:50 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [134 kB]
Get:51 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [15.8 kB]
Get:52 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [36.5 kB]
Get:53 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7060 B]
Get:[54](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:54) http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]
Fetched 12.2 MB in 3s (3562 kB/s)
Reading package lists...
/usr/bin/sudo apt-get install -y libegl1 libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 x11-utils libxcb-cursor0
Reading package lists...
Building dependency tree...
Reading state information...
libxcb-xfixes0 is already the newest version (1.14-3ubuntu3).
libxcb-xfixes0 set to manually installed.
libdbus-1-3 is already the newest version (1.12.20-2ubuntu4.1).
libdbus-1-3 set to manually installed.
The following additional packages will be installed:
  libegl-mesa0 libxcb-shape0 libxcb-util1 libxcb-xkb1 libxv1 libxxf86dga1
Suggested packages:
  mesa-utils
The following NEW packages will be installed:
  libegl-mesa0 libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0
  libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-util1
  libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxkbcommon-x11-0 libxv1
  libxxf86dga1 x11-utils
0 upgraded, 17 newly installed, 0 to remove and 34 not upgraded.
Need to get 545 kB of archives.
After this operation, 2125 kB of additional disk space will be used.
Get:1 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libegl-mesa0 amd64 22.2.5-0ubuntu0.1~22.04.3 [111 kB]
Get:2 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-randr0 amd64 1.14-3ubuntu3 [18.3 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-shape0 amd64 1.14-3ubuntu3 [6158 B]
Get:4 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-xinerama0 amd64 1.14-3ubuntu3 [5414 B]
Get:5 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-xinput0 amd64 1.14-3ubuntu3 [34.3 kB]
Get:6 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-xkb1 amd64 1.14-3ubuntu3 [32.8 kB]
Get:7 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxkbcommon-x11-0 amd64 1.4.0-1 [14.4 kB]
Get:8 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxv1 amd64 2:1.0.11-1build2 [11.2 kB]
Get:9 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxxf86dga1 amd64 2:1.1.5-0ubuntu3 [12.6 kB]
Get:10 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 x11-utils amd64 7.7+5build2 [206 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libegl1 amd64 1.4.0-1 [28.6 kB]
Get:12 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-util1 amd64 0.4.0-1build2 [11.4 kB]
Get:13 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-image0 amd64 0.4.0-2 [11.5 kB]
Get:14 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-render-util0 amd64 0.3.9-1build3 [10.3 kB]
Get:15 http://azure.archive.ubuntu.com/ubuntu jammy/universe amd64 libxcb-cursor0 amd64 0.1.1-4ubuntu1 [10.5 kB]
Get:16 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-icccm4 amd64 0.4.1-1.1build2 [11.5 kB]
Get:17 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 libxcb-keysyms1 amd64 0.4.0-1build3 [8746 B]
Fetched 545 kB in 1s (500 kB/s)
Selecting previously unselected package libegl-mesa0:amd64.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... [55](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:55)%
(Reading database ... [60](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:61)%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 221993 files and directories currently installed.)
Preparing to unpack .../00-libegl-mesa0_22.2.5-0ubuntu0.1~22.04.3_amd[64](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:65).deb ...
Unpacking libegl-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.3) ...
Selecting previously unselected package libxcb-randr0:amd64.
Preparing to unpack .../01-libxcb-randr0_1.14-3ubuntu3_amd64.deb ...
Unpacking libxcb-randr0:amd64 (1.14-3ubuntu3) ...
Selecting previously unselected package libxcb-shape0:amd64.
Preparing to unpack .../02-libxcb-shape0_1.14-3ubuntu3_amd64.deb ...
Unpacking libxcb-shape0:amd64 (1.14-3ubuntu3) ...
Selecting previously unselected package libxcb-xinerama0:amd64.
Preparing to unpack .../03-libxcb-xinerama0_1.14-3ubuntu3_amd64.deb ...
Unpacking libxcb-xinerama0:amd64 (1.14-3ubuntu3) ...
Selecting previously unselected package libxcb-xinput0:amd64.
Preparing to unpack .../04-libxcb-xinput0_1.14-3ubuntu3_amd64.deb ...
Unpacking libxcb-xinput0:amd64 (1.14-3ubuntu3) ...
Selecting previously unselected package libxcb-xkb1:amd64.
Preparing to unpack .../05-libxcb-xkb1_1.14-3ubuntu3_amd64.deb ...
Unpacking libxcb-xkb1:amd64 (1.14-3ubuntu3) ...
Selecting previously unselected package libxkbcommon-x11-0:amd64.
Preparing to unpack .../06-libxkbcommon-x11-0_1.4.0-1_amd64.deb ...
Unpacking libxkbcommon-x11-0:amd64 (1.4.0-1) ...
Selecting previously unselected package libxv1:amd64.
Preparing to unpack .../07-libxv1_2%3a1.0.11-1build2_amd64.deb ...
Unpacking libxv1:amd64 (2:1.0.11-1build2) ...
Selecting previously unselected package libxxf[86](https://github.com/hakonhagland/pytest-xvfb-test/actions/runs/5630867835/job/15257250882#step:4:87)dga1:amd64.
Preparing to unpack .../08-libxxf86dga1_2%3a1.1.5-0ubuntu3_amd64.deb ...
Unpacking libxxf86dga1:amd64 (2:1.1.5-0ubuntu3) ...
Selecting previously unselected package x11-utils.
Preparing to unpack .../09-x11-utils_7.7+5build2_amd64.deb ...
Unpacking x11-utils (7.7+5build2) ...
Selecting previously unselected package libegl1:amd64.
Preparing to unpack .../10-libegl1_1.4.0-1_amd64.deb ...
Unpacking libegl1:amd64 (1.4.0-1) ...
Selecting previously unselected package libxcb-util1:amd64.
Preparing to unpack .../11-libxcb-util1_0.4.0-1build2_amd64.deb ...
Unpacking libxcb-util1:amd64 (0.4.0-1build2) ...
Selecting previously unselected package libxcb-image0:amd64.
Preparing to unpack .../12-libxcb-image0_0.4.0-2_amd64.deb ...
Unpacking libxcb-image0:amd64 (0.4.0-2) ...
Selecting previously unselected package libxcb-render-util0:amd64.
Preparing to unpack .../13-libxcb-render-util0_0.3.9-1build3_amd64.deb ...
Unpacking libxcb-render-util0:amd64 (0.3.9-1build3) ...
Selecting previously unselected package libxcb-cursor0:amd64.
Preparing to unpack .../14-libxcb-cursor0_0.1.1-4ubuntu1_amd64.deb ...
Unpacking libxcb-cursor0:amd64 (0.1.1-4ubuntu1) ...
Selecting previously unselected package libxcb-icccm4:amd64.
Preparing to unpack .../15-libxcb-icccm4_0.4.1-1.1build2_amd64.deb ...
Unpacking libxcb-icccm4:amd64 (0.4.1-1.1build2) ...
Selecting previously unselected package libxcb-keysyms1:amd64.
Preparing to unpack .../16-libxcb-keysyms1_0.4.0-1build3_amd64.deb ...
Unpacking libxcb-keysyms1:amd64 (0.4.0-1build3) ...
Setting up libxcb-xinput0:amd64 (1.14-3ubuntu3) ...
Setting up libxcb-keysyms1:amd64 (0.4.0-1build3) ...
Setting up libxcb-shape0:amd64 (1.14-3ubuntu3) ...
Setting up libxxf86dga1:amd64 (2:1.1.5-0ubuntu3) ...
Setting up libxcb-render-util0:amd64 (0.3.9-1build3) ...
Setting up libxcb-icccm4:amd64 (0.4.1-1.1build2) ...
Setting up libxcb-util1:amd64 (0.4.0-1build2) ...
Setting up libxcb-xkb1:amd64 (1.14-3ubuntu3) ...
Setting up libxcb-image0:amd64 (0.4.0-2) ...
Setting up libegl-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.3) ...
Setting up libxcb-xinerama0:amd64 (1.14-3ubuntu3) ...
Setting up libxcb-cursor0:amd64 (0.1.1-4ubuntu1) ...
Setting up libxkbcommon-x11-0:amd64 (1.4.0-1) ...
Setting up libxv1:amd64 (2:1.0.11-1build2) ...
Setting up libxcb-randr0:amd64 (1.14-3ubuntu3) ...
Setting up libegl1:amd64 (1.4.0-1) ...
Setting up x11-utils (7.7+5build2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Error: The operation was canceled.
0s
tlambert03 commented 1 year ago

Hmm,

I've never had that one happen to me before, and I can't see anything obvious that would cause it in your workflow.

Do you possibly have any repo or organization concurrency limits that you might have hit?

Did you try rerunning it a couple times with the same result?

tlambert03 commented 1 year ago

oh sorry, I see why... it's cause your xvfb step failed in a different job:

/Users/runner/work/_temp/14737532-b625-430f-97c4-df84e3f36875.sh: line 1: /sbin/start-stop-daemon: No such file or directory

and because you don't have your matrix set to fail-fast: false... so github canceled your ubuntu job because your mac job failed (on a later step). It doesn't have anything to do with setup-qt-libs.

You might consider trying aganders/headless-gui in conjunction with this action (which will handle xvfb for you)

      - uses: tlambert03/setup-qt-libs@v1

      # ...

      - uses: aganders3/headless-gui@v1
        with:
          run: pytest
tlambert03 commented 1 year ago

closing this as it's not actionable here, but feel free to ask for more help

hakonhagland commented 1 year ago

it's cause your xvfb step failed in a different job

@tlambert03 Thanks for helping me out! I did not realize that the message "The operation was canceled" was due to the fail-fast strategy and a different job failing.

You might consider trying aganders/headless-gui in conjunction with this action

Yes that works perfectly! Thanks for the tip!

I also found that I may not have to use xvfb to run the tests with github action, it seems it is enough to set the environment variable QT_QPA_PLATFORM to "offscreen".

tlambert03 commented 1 year ago

Yep that will work for many things as well! I think you may find a couple things that need xvfb, but I can't remember them at the moment :)