@@ -16,7 +16,8 @@ export TestSetup, TestItem, TestItemResult
16
16
const RETESTITEMS_TEMP_FOLDER = mkpath (joinpath (tempdir (), " ReTestItemsTempLogsDirectory" ))
17
17
const DEFAULT_TESTITEM_TIMEOUT = 30 * 60
18
18
const DEFAULT_RETRIES = 0
19
- const DEFAULT_MEMORY_THRESHOLD = 0.99
19
+ const DEFAULT_MEMORY_THRESHOLD = Ref {Float64} (0.99 )
20
+
20
21
21
22
if isdefined (Base, :errormonitor )
22
23
const errmon = Base. errormonitor
@@ -65,6 +66,11 @@ function __init__()
65
66
DEFAULT_STDERR[] = stderr
66
67
DEFAULT_LOGSTATE[] = Base. CoreLogging. _global_logstate
67
68
DEFAULT_LOGGER[] = Base. CoreLogging. _global_logstate. logger
69
+ # Disable killing workers based on memory pressure on MacOS til calculations fixed.
70
+ # TODO : fix https://github.com/JuliaTesting/ReTestItems.jl/issues/113
71
+ @static if Sys. isapple ()
72
+ DEFAULT_MEMORY_THRESHOLD[] = 1.0
73
+ end
68
74
return nothing
69
75
end
70
76
@@ -141,7 +147,7 @@ will be run.
141
147
- `test_end_expr::Expr`: an expression that will be evaluated after each testitem is run.
142
148
Can be used to verify that global state is unchanged after running a test. Must be a `:block` expression.
143
149
- `memory_threshold::Real`: Sets the fraction of memory that can be in use before a worker processes are
144
- restarted to free memory. Defaults to $DEFAULT_MEMORY_THRESHOLD . Only supported with `nworkers > 0`.
150
+ restarted to free memory. Defaults to $( DEFAULT_MEMORY_THRESHOLD[]) . Only supported with `nworkers > 0`.
145
151
For example, if set to 0.8, then when >80% of the available memory is in use, a worker process will be killed and
146
152
replaced with a new worker before the next testitem is evaluated. The testitem will then be run on the new worker
147
153
process, regardless of if memory pressure dropped below the threshold. If the memory pressure remains above the
@@ -198,7 +204,7 @@ function runtests(
198
204
worker_init_expr:: Expr = Expr (:block ),
199
205
testitem_timeout:: Real = parse (Float64, get (ENV , " RETESTITEMS_TESTITEM_TIMEOUT" , string (DEFAULT_TESTITEM_TIMEOUT))),
200
206
retries:: Int = parse (Int, get (ENV , " RETESTITEMS_RETRIES" , string (DEFAULT_RETRIES))),
201
- memory_threshold:: Real = parse (Float64, get (ENV , " RETESTITEMS_MEMORY_THRESHOLD" , string (DEFAULT_MEMORY_THRESHOLD))),
207
+ memory_threshold:: Real = parse (Float64, get (ENV , " RETESTITEMS_MEMORY_THRESHOLD" , string (DEFAULT_MEMORY_THRESHOLD[] ))),
202
208
debug= 0 ,
203
209
name:: Union{Regex,AbstractString,Nothing} = nothing ,
204
210
tags:: Union{Symbol,AbstractVector{Symbol},Nothing} = nothing ,
0 commit comments