Skip to content

_node_cache in #2283 may sometimes cause tests to get lost #4007

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
Ms2ger opened this issue Sep 20, 2018 · 4 comments
Closed

_node_cache in #2283 may sometimes cause tests to get lost #4007

Ms2ger opened this issue Sep 20, 2018 · 4 comments
Labels
topic: fixtures anything involving fixtures directly or indirectly type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously

Comments

@Ms2ger
Copy link

Ms2ger commented Sep 20, 2018

Ref: web-platform-tests/wpt#13119

The cache is keyed on (type(x), x.fspath), and in our case, we ended with the exact same key for every test.

We are running pytest -vv tests (through tox) in resources/test, where tests is the subdirectory that contains our HTML test files. Abridged code is:

def pytest_collect_file(path, parent):
    return HTMLItem(str(path), parent)

class HTMLItem(pytest.Item, pytest.Collector):
    def __init__(self, filename, parent):
        name = extract_name(filename)
        super(HTMLItem, self).__init__(name, parent)

where parent is <Session 'test'>. The Node constructor initializes fspath to local('/web-platform-tests/resources/test')) for each of the tests, and we end up running only the first one.

Please let me know if I can provide more information.

#2283

@nicoddemus nicoddemus added type: bug problem that needs to be addressed topic: fixtures anything involving fixtures directly or indirectly labels Sep 20, 2018
@nicoddemus
Copy link
Member

Thanks @Ms2ger for the report!

@nicoddemus nicoddemus added the type: regression indicates a problem that was introduced in a release which was working previously label Sep 20, 2018
@nicoddemus
Copy link
Member

cc @jonozzz, I'm not sure how our cache should handle multiple nodes with the same key. Any suggestions?

@RonnyPfannschmidt
Copy link
Member

pytest should fail hard - those are file items that dont reffer to the owning file

@bluetech
Copy link
Member

bluetech commented Jan 4, 2024

There have been quite a few changes around this code, especially for pytest 8.0.0 (you can try it with pip install pytest==8.0.0rc1), I think this is probably fixed. Let us know if not.

@bluetech bluetech closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: fixtures anything involving fixtures directly or indirectly type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

4 participants