[Pytest-commit] Issue #641: MemoryError when writing junitxml for large test suite (hpk42/pytest)

Michael Howitz issues-reply at bitbucket.org
Thu Dec 11 08:12:17 CET 2014


New issue 641: MemoryError when writing junitxml for large test suite
https://bitbucket.org/hpk42/pytest/issue/641/memoryerror-when-writing-junitxml-for

Michael Howitz:

In a large project (> 3500 Tests) we get a MemoryError when writing the junit xml file.
(The host is our Jenkins CI server with 4 GB of RAM and 3 GB of swap.)

```
#!python

bin/py.test --nosugar --junitxml=parts/tests.xml --cov-report html --cov-report xml --cov-report term --cov src
============================= test session starts ==============================
platform linux2 -- Python 2.7.6 -- py-1.4.25 -- pytest-2.6.4
plugins: gocept.pytestlayer, cache, cov, sugar, remove-stale-bytecode
collected 3643 items

… Many, many tests which ran fine …

Traceback (most recent call last):
  File "bin/py.test", line 308, in <module>
    sys.exit(pytest.main())
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/config.py", line 41, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 413, in __call__
    return self._docall(methods, kwargs)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 424, in _docall
    res = mc.execute()
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 315, in execute
    res = method(**kwargs)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/main.py", line 116, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/main.py", line 109, in wrap_session
    exitstatus=session.exitstatus)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 413, in __call__
    return self._docall(methods, kwargs)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 424, in _docall
    res = mc.execute()
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 315, in execute
    res = method(**kwargs)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/terminal.py", line 349, in pytest_sessionfinish
    __multicall__.execute()
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/core.py", line 315, in execute
    res = method(**kwargs)
  File "/srv/jenkins/eggs/pytest-2.6.4-py2.7.egg/_pytest/junitxml.py", line 215, in pytest_sessionfinish
    ).unicode(indent=0))
  File "/srv/jenkins/eggs/py-1.4.25-py2.7.egg/py/_xmlgen.py", line 54, in unicode
    return u("").join(l)
MemoryError
```

Any suggestions?




More information about the pytest-commit mailing list