Slightly improve inferred types in runtests#100
Merged
giordano merged 3 commits intoJuliaTesting:mainfrom Mar 1, 2026
Merged
Conversation
giordano
reviewed
Mar 1, 2026
src/ParallelTestRunner.jl
Outdated
Comment on lines
+1004
to
+1005
| # Use a copy of p to prevent it from being boxed | ||
| p2 = p |
Collaborator
There was a problem hiding this comment.
This isn't a copy, it's the same as p, no?
Collaborator
There was a problem hiding this comment.
Also, how did you see p is boxed? JETLS doesn't detect it.
Contributor
Author
There was a problem hiding this comment.
Yes sorry I meant create a new binding instead of assigning to the existing one. I used Cthulhu.
Collaborator
There was a problem hiding this comment.
Can you please at least fix the comment? It's rather misleading as is now.
Collaborator
There was a problem hiding this comment.
JETLS doesn't detect it.
Oh, I had to wait some more time for JETLS to finish the analysis and report p as boxed.
Collaborator
giordano
reviewed
Mar 1, 2026
src/ParallelTestRunner.jl
Outdated
Comment on lines
+790
to
+791
| jobs = something(args.jobs, default_njobs()) | ||
| jobs = clamp(jobs, 1, length(tests)) | ||
| jobs::Int = clamp(jobs, 1, length(tests)) |
Collaborator
There was a problem hiding this comment.
Even with this change, the first jobs is reported as boxed by JETLS. Maybe do something like
_jobs = something(args.jobs, default_njobs())
jobs = clamp(_jobs, 1, length(tests))?
Collaborator
|
This PR broke reusing workers. |
giordano
added a commit
that referenced
this pull request
Mar 1, 2026
giordano
added a commit
that referenced
this pull request
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This avoids
panddonebeing boxed and improves the inferred type ofjobsfromAnytoInt. This also leads to some of the types of downstream variables --- e.g.,workers--- being inferred.