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/ignore all remaining test failures when run under conda #36372

Closed
wants to merge 9 commits into from

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Oct 1, 2023

Add a skip_conda flag that skips the test when executed in an active conda environment. This is used to disable the remaining handful of tests that are still failing under linux in combination with #35593 (refs #35597).

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@tobiasdiez tobiasdiez added the s: run conda ci Run the conda workflow on this PR. label Oct 1, 2023
@tobiasdiez tobiasdiez requested a review from isuruf October 1, 2023 08:21
@tobiasdiez tobiasdiez added s: needs review s: run conda ci Run the conda workflow on this PR. and removed s: run conda ci Run the conda workflow on this PR. labels Oct 1, 2023
@mkoeppe
Copy link
Member

mkoeppe commented Oct 1, 2023

I haven't looked at all the details, but many of the changes just disable the brial (polybori) tests.
So it would be cleaner to just disable the feature sage.rings.polynomial.pbori in the conda CI.

This can be done, for example, by passing the switch --hide sage.rings.polynomial.pbori to the doctester.

@tobiasdiez
Copy link
Contributor Author

tobiasdiez commented Oct 2, 2023

It's only the groebner basis method that fails, and only sometimes / for certain inputs.

@mkoeppe
Copy link
Member

mkoeppe commented Oct 2, 2023

I know. We have seen these failures on other platforms too. It's not conda-specific.

@tobiasdiez
Copy link
Contributor Author

What work is needed here? Even if pbori is demoted to experimental, these tests would fail in a local conda install (with optional features enabled) creating unnecessary noise.

@mkoeppe
Copy link
Member

mkoeppe commented Oct 2, 2023

What work is needed here? Even if pbori is demoted to experimental, these tests would fail in a local conda install (with optional features enabled) creating unnecessary noise.

Yes, when broken packages are used, they show up as doctest failures unless they are marked as "known bug".

But that these doctests are failing is not conda-specific, so it is not appropriate to mark them as conda-specific "skips". We are supporting lots of platforms and ways to install Sage.

@tobiasdiez
Copy link
Contributor Author

So I should mark these pbori lines as "known bug" instead?

@mkoeppe
Copy link
Member

mkoeppe commented Oct 2, 2023

Yes, please, either known bug or not tested. You can add a reason/reference in parentheses.

This will solve the problem also for homebrew, where we have been seeing these failures for a long time.

@tobiasdiez
Copy link
Contributor Author

Seems like the conda distribution of brial is working since yesterday with conda-forge/brial-feedstock#33. So I've removed the skips for this again.

vbraun pushed a commit that referenced this pull request Oct 8, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

Using conda to install all sage dependencies is pretty stable and has
been long enough in "experimental mode". We remove here the experimental
flag and in order to make sure that the workflow is not breaking enable
the conda-ci on all PRs. This also provides a) faster feedback as the
whole build+test takes only about 1.5h (which is less time then what
only the "incremental build" currently takes) and b) tests that the code
is working on all supported python versions. The last remaining failing
tests under linux are temporarily disabled in
#36372.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [ ] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #36373
Reported by: Tobias Diez
Reviewer(s): Matthias Köppe
@tobiasdiez
Copy link
Contributor Author

Can we please get this in to make the conda workflow pass?

@mkoeppe
Copy link
Member

mkoeppe commented Oct 28, 2023

I don't think this approach (skip_conda) is suitable for merging.

Note that we do not have skip_gentoo, skip_arch, skip_debian, ... directives -- for a good reason.

If there's something wrong with a particular doctest, that's a bug that needs to be analyzed and fixed properly instead of hiding it.

@mkoeppe
Copy link
Member

mkoeppe commented Oct 28, 2023

I'll remove the "blocker" label because the changes here (including codestyle fixes for ordering of imports??) are too unfocused for a CI fix. More restraint is needed when preparing an automatically applied CI fix.

@mkoeppe
Copy link
Member

mkoeppe commented Dec 22, 2023

We may think that known bug is for definite failures that occur on all platforms

I think it's a design flaw that these are effectively never tested.

@vbraun
Copy link
Member

vbraun commented Dec 23, 2023

Instead of parens I'd suggest colon to limit the scope of the magic comment, this is an already-existing Python linter convention

x = 1+2  # noqa: E226

so why not

sage: foo()    # known bug: conda

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 23, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
This is a workaround for:
- sagemath#36840

Cherry-picked from sagemath#36372

Author: @tobiasdiez

Reviewer: @mkoeppe

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36910 (merged here to fix merge conflict)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36926
Reported by: Matthias Köppe
Reviewer(s):
@tobiasdiez
Copy link
Contributor Author

Instead of skip_conda which is an optional tag specific to conda and which skips the test entirely, how about known_failure tag complemented with conda in parentheses.

Thanks for this constructive proposal. I had a similar idea yesterday after realizing that the remaining failures are most likely not conda specific anymore. It's just that the conda tests got more attention recently and are run more often. In particular there were no regular checks on any macos system before, and almost all of the random failures are macos specific.

So I'm in favor of replacing the "skip_conda" annotation by a "known_failure" annotation that skips the test on all platforms (or "known_failure: macos/linux" if you prefer). This could also be reused for the few other platform-specific failing tests that are currently annotated as "random". Should I go ahead and implement it?

But known_failure tag will not actually skip the test unlike your "skip_conda". Instead Matthias' baseline-stats code may monitor the test results and output useful report and decide to exit with error code 1 or 0.

I'm not sure if I completely follow here. Wouldn't this require to change the semantics of the "baseline-stats" (failing tests in the files listed there should still result in an error code unless they are annotated with "known_failure")? This is not possible as the baseline is also used to hide a lot of errors in the modularization setting.

You cannot write much into the supplemental comment, unless you want to clutter the source file with long comments only targeted to developers. The audience of the entire tag is basically the users. On the other hand, the baseline-stats file can contain longer comments about possible failures of the file that contains the failing doctests.

In my opinion, the comments should indicate enough information that users see that there are known problems with a given function. Everything more (like links to github action runs) should just go into an issue. Something like known_failure: random TimeoutError on MacOS #3333 seems short enough. So it seems overly complicated to have the baseline just to add a bit more details.

@mkoeppe
Copy link
Member

mkoeppe commented Dec 23, 2023

Tobias, stop the nonsense with the labels.

....: strictly_convex=False)
sage: K.is_strictly_convex()
sage: K = random_cone(min_ambient_dim=5, min_rays=2, strictly_convex=False) # skip_conda random timeouts
sage: K.is_strictly_convex() # skip_conda random timeouts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one stands out to me because I wrote random_cone(). I don't think this example should time out. All we have to do here is generate a subspace (or even half-space) of dimension 5 or more, which is pretty easy to do by generating a bunch of random vectors and adding them to the list of generators one at a time. You have to be very unlucky for it to not be "instantaneous."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkoeppe
Copy link
Member

mkoeppe commented Dec 23, 2023

Instead of parens I'd suggest colon to limit the scope of the magic comment, this is an already-existing Python linter convention

Note that the syntax with parentheses is already in use in the handling of the # optional, # needs tags (both parsing and unparsing).

@mkoeppe mkoeppe added the disputed PR is waiting for community vote, see https://groups.google.com/g/sage-devel/c/IgBYUJl33SQ label Dec 23, 2023
@kwankyu
Copy link
Collaborator

kwankyu commented Dec 23, 2023 via email

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 24, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
This is a workaround for:
- sagemath#36840

Cherry-picked from sagemath#36372

Author: @tobiasdiez

Reviewer: @mkoeppe

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36910 (merged here to fix merge conflict)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36926
Reported by: Matthias Köppe
Reviewer(s):
@tobiasdiez
Copy link
Contributor Author

I've opened #36960 now for this.

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 26, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
This is a workaround for:
- sagemath#36840

Cherry-picked from sagemath#36372

Author: @tobiasdiez

Reviewer: @mkoeppe

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36910 (merged here to fix merge conflict)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36926
Reported by: Matthias Köppe
Reviewer(s):
mkoeppe added a commit to mkoeppe/sage that referenced this pull request Dec 26, 2023
@tobiasdiez
Copy link
Contributor Author

This is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: doctest framework disputed PR is waiting for community vote, see https://groups.google.com/g/sage-devel/c/IgBYUJl33SQ r: invalid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants