Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

rand() in Julia test causes random failures of automated workflows

Closed Beginner friendly
#477 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from csrc-sdsu/mole

All issues in csrc-sdsu/mole

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.