Skip to content

Improve report when slaves collect different tests #556

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pytestbot opened this issue Aug 3, 2014 · 1 comment
Closed

Improve report when slaves collect different tests #556

pytestbot opened this issue Aug 3, 2014 · 1 comment
Labels
plugin: xdist related to the xdist external plugin type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus)


As described in #437 and #301, a test run stops when slaves collect a different number of tests.

This is the code that raises the error:

    # dsession.py:147    
    def init_distribute(self):
        assert self.collection_is_completed
        # XXX allow nodes to have different collections
        node_collection_items = list(self.node2collection.items())
        first_node, col = node_collection_items[0]
        for node, collection in node_collection_items[1:]:
            report_collection_diff(
                col,
                collection,
                first_node.gateway.id,
                node.gateway.id,
            )

If instead of raising an AssertionError in report_collection_diff we just return None if the collections differ, we obtain a better error message.

scheduling tests via LoadScheduling

=================================== ERRORS ====================================
_______ ERROR collecting source/python/ben10/_tests/pytest_fixtures.py ________
.env27\lib\site-packages\py\_path\local.py:620: in pyimport
    __import__(modname)
x:\pytest_cx_freeze\pytest\_pytest\assertion\rewrite.py:134: in find_module
    co = _read_pyc(fn_pypath, pyc)
x:\pytest_cx_freeze\pytest\_pytest\assertion\rewrite.py:312: in _read_pyc
    co = marshal.load(fp)
E   EOFError: EOF read where object expected

Which makes it easy to track down the source of the problem (btw, the above issue has a proposed fix in pull request #192).


@pytestbot
Copy link
Contributor Author

Original comment by Bruno Oliveira (BitBucket: nicoddemus, GitHub: nicoddemus):


Pull request 9 in xdist is a proposal to solve this.

@pytestbot pytestbot added type: enhancement new feature or API change, should be merged into features branch plugin: xdist related to the xdist external plugin labels Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: xdist related to the xdist external plugin type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

2 participants