Skip to content

Commit ae99e73

Browse files
authored
fix 1.11.0 test regression (#376)
* fix `1.11.0` test regression * relax test tolerance * relax tolerance
1 parent e6169ba commit ae99e73

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

test/tst_io.jl

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,34 @@ end
5656
end
5757
end
5858

59-
@testset "stringify plot - performance regression" begin
60-
p = heatmap(collect(1:30) * collect(1:30)')
61-
@test string(p; color = true) isa String # 1st pass - ttfp
62-
63-
measure = Sys.islinux() && VERSION > v"1.10.0" && length(VERSION.prerelease) < 2
59+
sombrero(x, y) = 30sinc((x^2 + y^2) / π)
6460

65-
if measure
66-
GC.enable(false)
67-
stats = @timed string(p; color = true) # repeated !
68-
@test stats.bytes / 1e3 < 400 # ~ 356kB on 1.10
69-
@test stats.time * 1e3 < 0.5 # ~ 0.3ms on 1.10
70-
GC.enable(true)
61+
@testset "stringify plot - performance regression" begin
62+
nightly = occursin("DEV", string(VERSION)) # or length(VERSION.prerelease) < 2
63+
measure = Sys.islinux() && VERSION > v"1.10.0-" && !nightly
64+
65+
let p = heatmap(collect(1:30) * collect(1:30)')
66+
@test string(p; color = true) isa String # 1st pass - ttfp
67+
68+
if measure
69+
GC.enable(false)
70+
stats = @timed string(p; color = true) # repeated !
71+
@test stats.bytes / 1e3 < 500 # ~ 356kB on 1.10
72+
@test stats.time * 1e3 < 0.8 # ~ 0.3ms on 1.10
73+
GC.enable(true)
74+
end
7175
end
7276

73-
sombrero(x, y) = 30sinc((x^2 + y^2) / π)
74-
p = surfaceplot(-8:0.5:8, -8:0.5:8, sombrero; axes3d = false)
75-
@test string(p; color = true) isa String # 1st pass - ttfp
77+
let p = surfaceplot(-8:0.5:8, -8:0.5:8, sombrero; axes3d = false)
78+
@test string(p; color = true) isa String # 1st pass - ttfp
7679

77-
if measure
78-
GC.enable(false)
79-
stats = @timed string(p; color = true) # repeated !
80-
@test stats.bytes / 1e3 < 160 # ~ 152kB on 1.10
81-
@test stats.time * 1e3 < 0.5 # ~ 0.26ms on 1.10
82-
GC.enable(true)
80+
if measure
81+
GC.enable(false)
82+
stats = @timed string(p; color = true) # repeated !
83+
@test stats.bytes / 1e3 < 160 # ~ 152kB on 1.10
84+
@test stats.time * 1e3 < 0.5 # ~ 0.26ms on 1.10
85+
GC.enable(true)
86+
end
8387
end
8488
end
8589

0 commit comments

Comments
 (0)