0

(note I doubt this is specific to PyQt so I've tagged with Qt too)

We have a 2 test suites (call them A and B) that we run with pytest on our dev workstations:

python -m pytest -c configfile -s -v A
python -m pytest -c configfile -s -v B

Suite B (and only that one) tests our PyQt components; A doesn't have any PyQt in it. We defined project A in Jenkins (version 1.658 btw) to run Suite A: it runs without issue in Jenkins. We did the same, defined a project B in Jenkins to run Suite B: this one fails intermittently after many tests, with a SYSTEM log message and a WARNING log message from Qt (caught by setting a handler via QtCore.qInstallMessageHandler()). The Jenkins log that captures the test suite B's stdout is:

SYSTEM log message from Qt: WindowCreationData::create: CreateWindowEx failed (Not enough storage is available to process this command.)
WARNING log message from Qt: Failed to create platform window for QWidgetWindow(0x705d260, name="FramedPartWidgetWindow") with flags QFlags<Qt::WindowType>(Window|WindowTitleHint|WindowSystemMenuHint|WindowMinMaxButtonsHint|WindowCloseButtonHint|WindowFullscreenButtonHint) (context: category=default)
Build step 'Execute Windows batch command' marked build as failure

The last line is output by Jenkins script running test suite B.

On the Jenkins machine (a Windows 7 Pro 64-bit platform, btw) that runs the test suites, I can open a Windows command shell and if I run the test suites from there, both test suites run without issue. Then I open a web browser, go to the Jenkins project page for suite B and click "Build now": this runs the same thing I ran from command shell, but I get the above error. If I do 10 builds, the above will happen for a different test every time, although always in the same "area". If I filter out the tests in the vicinity of where the failure occurred, the test runs further, but after removing 4 test classes this way, this no longer helps.

The issue is not desktop, because I am logged in. One difference between the command shell run vs the Jenkins run is that from shell, test suite B opens many (PyQt) windows and closes them. From Jenkins, I can't see any windows open so they seem to be opening in some "virtual" desktop. So maybe the issue the desktop. Do I need to somehow configure that virtual desktop to have larger graphics capacity?

The error seems to indicate that the process started by Jenkins is running out of some resource, but it's not clear what: there is plenty of drive space and memory.

Anyone have any idea where to go from here? I did a google search and all I could find is these, they don't look too promising although I will try the suggestions:

I'm not familiar with the intricacies of how the Jenkins service on Windows runs processes, so I'm at a loss.

Update 20161219: Apparently this is a known issues with GUI testing from Windows services, see my post on Bitnami Jenkins forum.

Community
  • 1
  • 1
Oliver
  • 27,510
  • 9
  • 72
  • 103
  • Did you look at the docs before asking this? – alphanumeric Jan 07 '17 at 15:36
  • @alphanumeric very funny, more so if you compare finding [scrollToItem](http://doc.qt.io/qt-5/qlistwidget.html#scrollToItem) from [QListWidget](http://doc.qt.io/qt-5/qlistwidget.html), to finding [GUI Testing in Windows](https://wiki.jenkins-ci.org/display/JENKINS/Tomcat) from [Windows Installation](https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins) (let alone from https://bitnami.com/stack/jenkins, which is what we were given). – Oliver Jan 07 '17 at 16:45

1 Answers1

0

Apparently this is a known issues with GUI testing from Windows services, see my post on Bitnami Jenkins forum, as is the case with the bitnami jenkins stack we use. As I mention in that post, the bottom of the page https://wiki.jenkins-ci.org/display/JENKINS/Tomcat says GUI testing in Windows is not likely to work when Jenkins is installed using Tomcat as a container installed as a service. The only option seems to be to setup Tomcat to run using the Windows Scheduler (instead of a service), but unfortunately the bitnami stack we use for jenkins does not seem to allow this, so the only solution for us is to install jenkins from scratch and tomcat as a scheduled task.

It appears that on Windows (based on docs for setting up Jenkins to test GUI via Squish),

  • Install Jenkins master (this should be doable via bitnami stack in a Linux VM)
  • Install Windows slave. Make sure to not start the slave as Windows Service at Launch method. Windows Services are intended to run command line applications but not to run applications which consist of a GUI. Starting the Jenkins slave as JNLP via Launch slave agents via Java Web Start works fine.
  • Setup a node inside Jenkins at Manage Jenkins|Manage Nodes|New Node.
  • Read https://kb.froglogic.com/display/KB/Automation+on+Windows

This page seems to aggregate several posts related to this issue.

Oliver
  • 27,510
  • 9
  • 72
  • 103