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

Fix timeout in feature test for Mathematica #33248

Closed
slel opened this issue Jan 30, 2022 · 13 comments
Closed

Fix timeout in feature test for Mathematica #33248

slel opened this issue Jan 30, 2022 · 13 comments

Comments

@slel
Copy link
Member

slel commented Jan 30, 2022

Doctesting src/sage/features/interfaces.py
fails for me with a timeout.

sage: from sage.features.interfaces import Mathematica
sage: Mathematica().is_present()

In this ticket we mark the example
# not tested to skip it in doctests.

CC: @slel

Component: doctest framework

Keywords: features, mathematica, timeout

Author: Samuel Lelièvre

Branch/Commit: 868109b

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/33248

@slel slel added this to the sage-9.5 milestone Jan 30, 2022
@slel
Copy link
Member Author

slel commented Jan 30, 2022

comment:1

Set milestone to sage-9.6 after Sage 9.5 release.

@slel slel modified the milestones: sage-9.5, sage-9.6 Jan 30, 2022
@slel
Copy link
Member Author

slel commented Jan 30, 2022

comment:2

Could we give up on Mathematica().is_present()
after say a minute?

Maybe using one of the answers to:

@seblabbe
Copy link
Contributor

comment:3

Do you know at which line it gets stuck in what is below ?

    def _is_present(self):
        """
        TESTS::

            sage: from sage.features.interfaces import InterfaceFeature
            sage: from sage.interfaces.sage0 import Sage
            sage: f = InterfaceFeature("sage0", "sage.interfaces.sage0")
            sage: f.is_present()
            FeatureTestResult('sage0', True)
        """
        result = self.module.is_present()
        if not result:
            return result
        m = importlib.import_module(self.module.name)
        try:
            interface = getattr(m, self.name)
        except Exception as exception:
            return FeatureTestResult(self, False,
                                     reason=f"Interface {self.name} cannot be imported: {exception}")
        try:
            interface('2+3')
            return FeatureTestResult(self, True)
        except Exception as exception:
            return FeatureTestResult(self, False,
                                     reason=f"Interface {interface} is not functional: {exception}")

@mkoeppe
Copy link
Member

mkoeppe commented Jan 30, 2022

comment:4

I think this doctest should be marked # not tested

@slel
Copy link
Member Author

slel commented Jan 31, 2022

comment:5

Mathematica is installed on that machine
but requires a password or token to start.

Running math in a shell session goes:

$ math
Mathematica 12.1.1 Kernel for Linux x86 (64-bit)
Copyright 1988-2020 Wolfram Research, Inc.

Mathematica 12.1.1 Kernel cannot find a valid password.

For automatic Web Activation enter your activation key
(enter return to skip Web Activation):

This is likely what makes the feature detection hang.

@slel
Copy link
Member Author

slel commented Jan 31, 2022

comment:6

Replying to @mkoeppe:

I think this doctest should be marked # not tested

Here is a branch doing that.


New commits:

868109b33248: Skip Mathematica feature detection doctest

@slel
Copy link
Member Author

slel commented Jan 31, 2022

Changed keywords from features, mathematica to features, mathematica, timeout

@slel
Copy link
Member Author

slel commented Jan 31, 2022

Commit: 868109b

@slel
Copy link
Member Author

slel commented Jan 31, 2022

Branch: u/slelievre/33248

@slel
Copy link
Member Author

slel commented Jan 31, 2022

Author: Samuel Lelièvre

@slel

This comment has been minimized.

@mkoeppe
Copy link
Member

mkoeppe commented Jan 31, 2022

Reviewer: Matthias Koeppe

@vbraun
Copy link
Member

vbraun commented Feb 13, 2022

Changed branch from u/slelievre/33248 to 868109b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants