rand() in Julia test causes random failures of automated workflows
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- julia
- Domain
- testing-qa
Research direction
Start with mole/julia/tests/Operators/Divergence.jl and Gradient.jl, then run the affected Julia tests to reproduce the intermittent tolerance failure. Check how rand() generates xticks and yticks and make the test inputs reliably avoid problematic clustering; done means the tests pass consistently in automated workflows.
Written by the indexing model from the issue text.
Description
Describe the bug
The rand() function in the test could cause the test to get an error larger than the tolerance, failing the test on pull or commit actions. Rand() could cluster the points somewhere, and the operators may struggle with that packing.
To Reproduce
@testset "Testing non uniform 2-D divergence for order k=$k" for k in 2:2:8
m = 2 * k + 1
n = m + 1
xticks = sort(rand(m + 1)) # HERE
yticks = sort(rand(n + 1)) # HERE
D = Operators.div(k, xticks, yticks)
@test issparse(D)
field = ones((m + 1) * n + m * (n + 1), 1)
sol = D * field
@test norm(sol) < tol
end
If these are randomly packed, the error sol will be > tol. Either increase tolerance or prevent clustering of rand().
This is the primary cause of the failing Julia tests, and why rerunning them clears the failed test.
Occurs in:
mole/julia/tests/Operators/
- Divergence.jl
- Gradient.jl
- Dominant language
- MATLAB
- Stars
- 41
- Forks
- 85
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 16
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from csrc-sdsu/mole
-
Documentation Good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Documentation Good first issue MOLE.jl
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
C++ Enhancement Examples
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
csrc-sdsu/mole#464 · 1 reaction ·
Maintainers usually reply within 1 day
-
Documentation Good first issue MOLE.jl
Difficulty 1/5 Under an hour Newbie friendliness 90/100
csrc-sdsu/mole#443 · 3 comments ·
Maintainers usually reply within 1 day
-
Rewriting python/examples/elliptic1D.py to be PythonicPossibly taken @cpaolini claimed this 5 days ago. OpenExamples python
csrc-sdsu/mole#474 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
rmbase ERP in studyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
flatironinstitute/numbl#65 ·
-
Component: Continuous Integration Component: MATLAB Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day