Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

improved user experience for mochitest running

18 views
Skip to first unread message

Sergey Yanovich

unread,
May 16, 2008, 2:44:35 PM5/16/08
to
While running mochitest, I learned that it breaks, if the window loses
focus. Leaving the box alone for the test running is not an option, so I
experimented a bit with virtualization, but found a viable solution with
plain X server.

The resulting approach is using X server, so it won't work on Windows.
$-prefixed commands as a regular user, #-prefixed as root

1. Launch a shell for testing (console or xterm are both fine).
2. Prepare the shell to work with the second X screen:
$ export DISPLAY=:2.0

3. Set path to xauth key file:
$ export XAUTHORITY=~/.Xauthority2

4. Edit your xorg.conf to create a dummy server layout:
4.1 Add Dummy "Device":

Section "Device"
Identifier "Dummy Video Card"
Driver "dummy"
EndSection

4.2 Add Dummy "Screen":

Section "Screen"
Identifier "Dummy Screen"
Device "Dummy Video Card"
// Use any monitor from you exisiting config here
Monitor "Generic Monitor"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1024x768"
EndSubSection
EndSection

4.3. Create Dummy "ServerLayout"

Section "ServerLayout"
Identifier "Dummy"
Screen "Dummy Screen"
// Use any keyboard from you exisiting config here
InputDevice "Generic Keyboard"
// Use any mouse from you exisiting config here
InputDevice "Configured Mouse"
EndSection

5. Run the second Dummy X server:
5.1 From another console:
$ XAUTHORITY=~regular_username/.Xauthority2 startx -- :2.0 -layout Dummy

5.2 From another ssh/xterm as root:
# XAUTHORITY=~regular_username/.Xauthority2 startx -- :2.0 -layout Dummy

5.2.1 Allow regular user to connect:
# chown regular_username ~regular_username/.Xauthority2

6. Run mochitest from the first console:
$ cd $(OBJDIR)/_tests/testing/mochitest
$ nice python runtests.py --log-file=~/mochitest.log --file-level=DEBUG
--console-level=DEBUG

Despite nice, the mochitest suite runs ~10% faster on dummy screen, than
on my normal screen, not telling about virtual machine. And I can work
normally while tests run.

Good luck trying this,
--
Sergey Yanovich

Jeff Walden

unread,
May 18, 2008, 4:15:15 PM5/18/08
to Sergey Yanovich
I don't run Linux and haven't found time to make a VM, but this stuff looks awesome. Running Mochitests has been a thorn in the side of developers for quite awhile; I suspect eventually we'll get tryserver support, but that's really just a workaround for the default experience being bad.

Is there any way we could just fold this or something like it into the default run environment? I've not fooled with using multiple X servers that much except a brief spate of Xnesting when I attempted to fix a gnome-panel bug back in the day and needed a different X display for gdbing purposes, but it seems like it should be possible to require neither root access nor any manual effort beyond a single commandline argument to runtests.py.

I filed bug 434365[0] to deal with this on Linux, probably with a commandline option. If you have any suggestions, feedback, patches you could drop in there on how to make something like what you suggest "just work", I know a lot of people who'd love to hear it. For anyone in m.d.p.linux, this would be an easy way to make a big impact on development on Linux.

I dithered on where this thread should continue and eventually decided the Linux newsgroup rather than the current one, since the current scheme is only useful on an X-running platform and is hopelessly nonportable to Windows or OS X. If you're not already reading the Linux group, the load's very light, and we could use some fresh blood and enthusiasm there anyway.

Jeff

0. https://bugzilla.mozilla.org/show_bug.cgi?id=434365

Sergey Yanovich

unread,
May 20, 2008, 7:30:35 AM5/20/08
to
The long sequence I posted initially has been boiled down to a *SINGLE*
command by Karl Tomlinson and Zack Weinberg in bug 434365[0]:

$ nice xvfb-run --auto-servernum python runtests.py
--log-file=~/mochitest.log --file-level=DEBUG --autorun
--close-when-done --console-level=DEBUG

The only requirement is Xvfb package [1].

0. https://bugzilla.mozilla.org/show_bug.cgi?id=434365
1. http://en.wikipedia.org/wiki/Xvfb

I've always known Linux is the right platform to hack Mozilla, but I've
never thought it'll be so awesome!

--
Sergey Yanovich

0 new messages