Skip to content
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

Testing hysteresis with different selection methods #14433

Open
greenc-FNAL opened this issue Jan 8, 2020 · 7 comments
Open

Testing hysteresis with different selection methods #14433

greenc-FNAL opened this issue Jan 8, 2020 · 7 comments
Labels
python2 robustness Enhancements to reduce fragility under different conditions. tests General test capability(ies)

Comments

@greenc-FNAL
Copy link
Member

Since 4beb9fc, develop has exhibited the following worrying behavior:

spack test -vv cmd_extensions.py

executes two tests, cmd_extensions.py::test_simple_command_extension and cmd_extensions.py::test_command_with_import, the former passing and the latter failing with a strange YAML validation schema error:

<snip>
self = <jsonschema.validators.Validator object at 0x7f4b72b7a0d0>
schema = {'$schema': 'http://json-schema.org/schema#', 'additionalProperties': False, 'properties': {'config': {'default': {}, ...{...}]}, 'ccache': {'type': 'boolean'}, ...}, 'type': 'object'}}, 'title': 'Spack core configuration file schema', ...}
types = (), resolver = None, format_checker = None

    def __init__(
        self, schema, types=(), resolver=None, format_checker=None,
    ):
        self._types = dict(self.DEFAULT_TYPES)
        self._types.update(types)

        if resolver is None:
>           resolver = RefResolver.from_schema(schema)
E           AttributeError: 'NoneType' object has no attribute 'from_schema'

../../external/jsonschema/validators.py:64: AttributeError

In contrast:

spack test -vvk cmd_extensions

while executing the same two tests—in apparently the same order—shows that both tests pass. This is in fact what happens to these tests in CI.

Any insight into locating the source of the hysteresis would be appreciated.

@greenc-FNAL greenc-FNAL added bug tests General test capability(ies) robustness Enhancements to reduce fragility under different conditions. labels Jan 8, 2020
@greenc-FNAL
Copy link
Member Author

@tgamblin

@tgamblin
Copy link
Member

tgamblin commented Jan 9, 2020

@chissg: see #14319 for details on the change. You can add a -k option to get the old behavior you want.

I agree that pytest's error message is unhelpful here... I'd normally say we should upgrade the external package, but we're tied to a relatively old version of pytest to continue supporting Python 2.6. Would it help if we added something to catch the attribute error and say "did you mean..."?

@tgamblin tgamblin removed the bug label Jan 9, 2020
@greenc-FNAL
Copy link
Member Author

@tgamblin I'm still not sure of the correlation between the first form of the invocation and the error. What is pytest not doing that is causing the second test to fail, or is there a weakness in the test I should be fixing?

@tldahlgren
Copy link
Contributor

tldahlgren commented Jan 9, 2020

FWIW. I ran the tests both ways -- from develop at 6b3e173 -- and they pass regardless.

@greenc-FNAL
Copy link
Member Author

Still trying to ascertain what makes this reproducible for me but not for anyone else. Platform is SLF7.7.

@greenc-FNAL
Copy link
Member Author

@tgamblin I have been able to reproduce this on a (different) SLF7.7 machine. The error does not occur if /usr/bin/python3 is available, which is used for preference. It does occur if /usr/bin/python (corresponding to version 2.7.5) is invoked. On the machine where python3 is not present the invocation of spack test -vv cmd_extensions.py fails reliably; on the other machine it passes unless I change the order of preference of Python executables at

for cmd in python3 python python2; do
to invoke Python2 for preference. Quite what is sensitive to Python2 versus Python3 I have no idea, but at least I know I'm not hallucinating.

@alalazo
Copy link
Member

alalazo commented May 4, 2023

@greenc-FNAL Can we close this one, since Spack doesn't support running with Python 2 anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python2 robustness Enhancements to reduce fragility under different conditions. tests General test capability(ies)
Projects
None yet
Development

No branches or pull requests

4 participants