Page MenuHomePhabricator

Xvfb not working in Fresh
Closed, ResolvedPublic

Description

I'm following instructions on Selenium/How-to/Record videos of test runs page, but I'm getting _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

~/Documents/gerrit/mediawiki/core$ fresh-node -env -net
# fresh: 21.04.1 (2021-04-29)
# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.3-s2
# software: Debian GNU/Linux 9 (stretch)
#           Node.js v10.15.2 (npm 6.14.5)
#           Chromium 73.0.3683.75
#           Mozilla Firefox 68.12.0esr
#           JSDuck 5.3.4 (Ruby 2.3.3)
# mount: /core      ➟ /Users/z/Documents/gerrit/mediawiki/core      (read-write)
#        /core/.git ➟ /Users/z/Documents/gerrit/mediawiki/core/.git (read-only)
# env: MW_*, MEDIAWIKI_*
# net: expose host

🌱  Fresh!

nobody@docker-desktop:/core$ export DISPLAY=:1

nobody@docker-desktop:/core$ Xvfb "$DISPLAY" -screen 0 1280x1024x24 &
[1] 8
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle triaged this task as Medium priority.Sep 17 2021, 2:16 PM

I also got _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created. but the following selenium-test run normally captured video.

I have no name!@lens0021:/MyExtension$ export DISPLAY=:0
I have no name!@lens0021:/MyExtension$ Xvfb "$DISPLAY" -screen 0 1280x1024x24 &
[1] 8
ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
I have no name!@lens0021:/MyExtension$ npm run selenium-test

> selenium-test
> wdio tests/selenium/wdio.conf.js


Execution of 2 spec files started at 2021-10-14T15:57:35.045Z
...
[0-1] 
	Video location: /MyExtension/tests/selenium/log/Special%3ASanctions-should-hide-and-show-the-form-as-the-conditions-change-2021-10-14T15-58-05-701Z.mp4 
...
I have no name!@lens0021:/Sanctions$ ls tests/selenium/log/*.mp4
tests/selenium/log/Sanction-should-be-rejected-if-three-users-object-2021-10-14T15-57-47-026Z.mp4
tests/selenium/log/Special%3ASanctions-should-hide-and-show-the-form-as-the-conditions-change-2021-10-14T15-58-05-701Z.mp4
...

re-execution of Xvfb failed

I have no name!@lens0021:/MyExtension$ Xvfb "$DISPLAY" -screen 0 1280x1024x24
(EE) 
Fatal server error:
(EE) Server is already active for display 0
	If this server is no longer running, remove /tmp/.X0-lock
	and start again.
(EE)
dpifke removed dpifke as the assignee of this task.Apr 4 2022, 6:32 PM
dpifke added a subscriber: dpifke.
Krinkle added a subscriber: Krinkle.

Xvfb and selenium testing are an essential use case of fresh-node.

I have followed the steps at https://www.mediawiki.org/wiki/Selenium/How-to/Record_videos_of_test_runs on macOS 10.15 with fresh-node14 as released with Fresh 22.05 yesterday.

Per @Lens0021, this indeed appears to work correctly. I filed T202710 about avoiding the error. Marking this as solved as the original description was from a prespective of Xvfb not working in Fresh, which was not broken / is resolved.

See also: T202710: Xvfb causes _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created

I can confirm that the error message is still there (T308129: Avoid "_XSERVTransmkdir" warning noise when starting Xvfb in fresh-node) but the important thing is that videos are recorded.