Skip to content

Commit 36ecbd1

Browse files
try to make tests deterministic
1 parent 5f6b5ae commit 36ecbd1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/OptimizationNLopt/test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ using Test, Random
117117
# @test sol.retcode == ReturnCode.Success
118118
@test 10 * sol.objective < l1
119119

120+
Random.seed!(1)
120121
prob = OptimizationProblem(optprob, [0.5, 0.5], _p, lcons = [-Inf, -Inf],
121122
ucons = [0.0, 0.0], lb = [-1.0, -1.0], ub = [1.0, 1.0])
122123
sol = solve(prob, NLopt.GN_ISRES(), maxiters = 1000)

test/minibatch.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ optprob = OptimizationProblem(optfun, pp, train_loader)
6060

6161
res1 = Optimization.solve(optprob,
6262
Optimization.Sophia(), callback = callback,
63-
maxiters = 1000)
63+
maxiters = 2000)
6464
@test 10res1.objective < l1
6565

6666
optfun = OptimizationFunction(loss_adjoint,

0 commit comments

Comments
 (0)