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

src/tox.ini (coverage:run): Set concurrency = multiprocessing,threads #37010

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Jan 4, 2024

📝 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

@mkoeppe mkoeppe self-assigned this Jan 4, 2024
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from d66e3fd to 31971bf Compare January 14, 2024 21:37
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from 31971bf to 123fbd9 Compare January 22, 2024 01:06
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from 123fbd9 to d84231b Compare February 2, 2024 23:21
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from d84231b to fd155f8 Compare February 14, 2024 00:41
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from fd155f8 to bde14eb Compare February 25, 2024 18:29
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch 2 times, most recently from 87be537 to 3565c33 Compare April 1, 2024 00:39
Copy link

github-actions bot commented Apr 1, 2024

Documentation preview for this PR (built with commit c1758ed; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 22, 2024

Let's run this again.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 22, 2024

Unknown concurrency choices: threads
Error: Process completed with exit code 1.

Hm...

src/tox.ini Show resolved Hide resolved
src/tox.ini Outdated Show resolved Hide resolved
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 28, 2024

Thanks for the fix! Now it seems to work well

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 28, 2024

There are still a few warnings Couldn't combine data file .coverage/.coverage.406549dc1e48.422.XQfVypyx: Data file '/sage/.coverage/.coverage.406549dc1e48.422.XQfVypyx' doesn't seem to be a coverage data file though.

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 28, 2024

Are we using "--parallel-mode" flag?

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 28, 2024

Ah, yes. I see "-p".

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 28, 2024

In build.yml, I see

      - name: Test all files (sage -t --long ${{ matrix.tests }})
        if: (success() || failure()) && steps.container.outcome == 'success'
        run: |
          mkdir .coverage
          rm -rf /sage/.coverage
          ln -s $(pwd)/.coverage /sage/
          cd /sage
          ./sage -python -m pip install coverage
          ./sage -python -m coverage run --rcfile=src/tox.ini src/bin/sage-runtests --force-lib --long -p4 --format github --random-seed=286735480429121101562228604801325644303 ${{ matrix.tests }} 

In src/tox.ini, I see

[testenv:coverage.py]
# https://coverage.readthedocs.io/en/latest/index.html
description =
    run the Sage doctester with Coverage.py
## This toxenv bypasses the virtual environment set up by tox.
passenv = {[sagedirect]passenv}
setenv  = {[sagedirect]setenv}
envdir  = {[sagedirect]envdir}
allowlist_externals = {[sagedirect]allowlist_externals}
commands_pre =
    {env:SAGE} -pip install -U coverage
commands =
    {env:SAGE} --python -m coverage run "{toxinidir}/../venv/bin/sage-runtests" -p 0 {posargs:--all}
commands_post =
    {env:SAGE} --python -m coverage combine
    {env:SAGE} --python -m coverage report   
...
[coverage:run]
source = sage
concurrency = multiprocessing
data_file = .coverage/.coverage
disable_warnings = no-data-collected  

There is "-p" in the command in tox.ini, but there is no "-p" in the command in build.yml. Is this flag applied to the coverage command in the workflow?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 28, 2024

There's a -p4 in the command

Matthias Koeppe and others added 2 commits July 27, 2024 11:56
@mkoeppe mkoeppe force-pushed the coverage.py-threads branch from 0a1dae9 to c1758ed Compare July 27, 2024 18:56
@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

There's a -p4 in the command

isn't it for src/bin/sage-runtests? I meant -p for coverage command...

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Now it seems to work well

I feel that we did not fix the root problem yet...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 1, 2024

There's a -p4 in the command

isn't it for src/bin/sage-runtests? I meant -p for coverage command...

All the -p flags are for sage-runtests, not for coverage

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

OK. Then the -p flag for coverage is

  -p, --parallel-mode   Append the machine name, process id and random number
                        to the data file name to simplify collecting data from
                        many processes.

Don't we need this flag? (That was perhaps what I was thinking a month ago)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 1, 2024

Don't we need this flag?

No, because that is configured in src/tox.ini already

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Sorry but where in src/tox.ini?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 1, 2024

It's the very line that is modified here, in the [coverage:run] section

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Do you mean concurrency = multiprocessing,thread implies --parallel-mode?

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Now it seems to work well

I feel that we did not fix the root problem yet...

Do you agree with this?

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Anyway, this PR is likely to alleviate the situation. Let's merge.

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 1, 2024

Let's keep the issue #36539 open though.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 1, 2024

I feel that we did not fix the root problem yet...

Do you agree with this?

Yes.

Thanks for the review!

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 2, 2024
…ltiprocessing,threads`

    
<!-- ^^^^^
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 -->

<!-- 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. -->
- Partially addresses sagemath#36539

### 📝 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.
- [x] 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: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#37010
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
@vbraun vbraun merged commit 6f16f81 into sagemath:develop Aug 3, 2024
20 checks passed
@mkoeppe mkoeppe added this to the sage-10.5 milestone Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants