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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jenkins failure #648
Comments
@gforcada connection timeout when the test tries to do a request against the functional test fixture. Maybe a port allocation problem on Jenkins? |
In the traceback above, the error is in |
On Python3 locally I get hundreds of these warnings, each with a different port number:
That can easily cause problems on Jenkins, especially when multiple jobs are run in parallel. As far as I see, no open ports/sockets are lingering after all the tests have run, so at the end it works out. On Python 2 I do not see these warnings. Strangely, after I run the tests (
So the source code contains output from a local test run. I guess this is for debugging purposes. It has port 55001, but on coredev (or latest plone.testing?) the ports are randomized |
Hey, I didn't mean to close this issue. I was still editing my previous comment... I guess what happens in plone.restapi on Python 3 is that too many ports are left open during parallel runs, and then either there are no open ports left, or maybe (worse) a test gets access to a port that is opened by a test from a different test run. @Rotonen, would you know if there is a spot in |
Ah wait, we don't get a different randomized port for each test, but for each process, or maybe each layer. When checking with
And with those four parallel runs, on Python 3 at least, I get an error in three of them, like this:
|
I did another four parallel test runs on Python 3. Now three of the four runs had two errors, and the fourth one had one error. |
With four parellel Python 2 runs, I get a few errors like this:
Halfway through, two of the four runs have this error once. It stays that way at the end of the four runs. |
A shot in the dark: something is not closing the file descriptors of the sockets being opened via |
Also |
On Python 2 I sometimes get the same error also in a single run. |
@mauritsvanrees we need to set a fixed port in order to being able to test the full output path. Since we test against files, we can't parameterize this easily. I stopped doing port allocations in tests on CI long time ago because it was a constant source of troubles. Running each test in its own container/vm is a much more scalable approach IMHO. |
As One serious option to consider would be to roll AWS AMI images for the dependencies of a test run and run each build on a fresh server now that they support per second billing (one minute minimum charge). That'd allow for pretty quick parallel builds too - and no queuing. |
@mauritsvanrees are these happening on the ZServer layer or on the WSGI layer? So far the WSGI layer has been rather troublesome in regards to isolation. |
@Rotonen These are in tests that use the plone.restapi/src/plone/restapi/testing.py Lines 200 to 205 in 0935b7f
|
@tisto wrote:
Those tests don't actually fail. I think you are referring to plone.restapi/test-no-uncommitted-doc-changes.in Lines 16 to 21 in 0935b7f
|
For the unclosed sockets, there is actually already issue #636. |
I have created a PR: #651 |
Branch: refs/heads/master Date: 2018-12-27T16:58:44+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.restapi@7e57735 Close the api_session in tests. This prevents lots of ResourceWarnings about unclosed sockets. Fixes plone/plone.restapi#636 and plone/plone.restapi#648. Files changed: M CHANGES.rst M src/plone/restapi/tests/test_documentation.py Repository: plone.restapi Branch: refs/heads/master Date: 2018-12-28T00:01:34+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.restapi@fbd357b Merge pull request #651 from plone/close-api-session Close the api_session in tests. Files changed: M CHANGES.rst M src/plone/restapi/tests/test_documentation.py
I've been assuming that the leaked sockets are from some bug in the shutdown of webtest.http.StopableWSGIServer which is used by the WSGI_SERVER fixture (which is confusingly what you now get when you import plone.testing.z2.ZSERVER_FIXTURE). But I haven't looked into it enough to have actual evidence. Possibly something similar to zopefoundation/zope.server#14, since StopableWSGIServer extends waitress.TcpWSGIServer I believe waitress grew out of zope.server. But again, I haven't taken a close look. |
It should be less of a problem now that PR #651 and #652 have been merged. |
On Jenkins we often get one ConnectionError in a seemingly random test. Happens on both Python 2 and 3. Retrying after a short pause helps. Fixes #648
I added a pdb, and tried a few parallel test runs. When getting a ConnectionError, I could see that the port was still open, and I could view the Plone site in a browser just fine. |
On Jenkins we often get one ConnectionError in a seemingly random test. Happens on both Python 2 and 3. Retrying after a short pause helps. Fixes #648
Branch: refs/heads/master Date: 2018-12-31T13:08:28+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.restapi@e6b601c Tests: retry request on ConnectionError. On Jenkins we often get one ConnectionError in a seemingly random test. Happens on both Python 2 and 3. Retrying after a short pause helps. Fixes plone/plone.restapi#648 Files changed: M CHANGES.rst M src/plone/restapi/testing.py Repository: plone.restapi Branch: refs/heads/master Date: 2018-12-31T19:03:25+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.restapi@e8a9f4f Merge pull request #654 from plone/issue-648-retry-on-connectionerror Tests: retry request on ConnectionError. Files changed: M CHANGES.rst M src/plone/restapi/testing.py
Any idea what could go wrong here? It is failing since yesterday 馃槙
The text was updated successfully, but these errors were encountered: