Skip to content

Improve report when slaves collect different tests #556

Closed
@pytestbot

Description

@pytestbot

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).


Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: xdistrelated to the xdist external plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions