From 44c9bf559bd99899e7858cc37930f91a9de932d2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 2 Jan 2021 12:21:19 -0700 Subject: [PATCH] std: disable a couple tests on windows They are passing but we're hitting OOM on the Windows CI server. This is to buy us more time until stage2 rescues us from the CI memory crisis. --- lib/std/hash/crc.zig | 10 ++++++++++ lib/std/rand/ziggurat.zig | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/std/hash/crc.zig b/lib/std/hash/crc.zig index b132713a7e9388cd941605cfa498afbc5fc42876..a2d6ed429ccd1202a5b1d7e2e99294a4f44b563a 100644 --- a/lib/std/hash/crc.zig +++ b/lib/std/hash/crc.zig @@ -102,7 +102,11 @@ pub fn Crc32WithPoly(comptime poly: Polynomial) type { }; } +const please_windows_dont_oom = std.Target.current.os.tag == .windows; + test "crc32 ieee" { + if (please_windows_dont_oom) return error.SkipZigTest; + const Crc32Ieee = Crc32WithPoly(.IEEE); testing.expect(Crc32Ieee.hash("") == 0x00000000); @@ -111,6 +115,8 @@ test "crc32 ieee" { } test "crc32 castagnoli" { + if (please_windows_dont_oom) return error.SkipZigTest; + const Crc32Castagnoli = Crc32WithPoly(.Castagnoli); testing.expect(Crc32Castagnoli.hash("") == 0x00000000); @@ -167,6 +173,8 @@ pub fn Crc32SmallWithPoly(comptime poly: Polynomial) type { } test "small crc32 ieee" { + if (please_windows_dont_oom) return error.SkipZigTest; + const Crc32Ieee = Crc32SmallWithPoly(.IEEE); testing.expect(Crc32Ieee.hash("") == 0x00000000); @@ -175,6 +183,8 @@ test "small crc32 ieee" { } test "small crc32 castagnoli" { + if (please_windows_dont_oom) return error.SkipZigTest; + const Crc32Castagnoli = Crc32SmallWithPoly(.Castagnoli); testing.expect(Crc32Castagnoli.hash("") == 0x00000000); diff --git a/lib/std/rand/ziggurat.zig b/lib/std/rand/ziggurat.zig index c84667603e3ff61fe2adf3433e9ac515e14a11f1..fe120943d7eaee15c2a0693420e2f0e2e188e9d4 100644 --- a/lib/std/rand/ziggurat.zig +++ b/lib/std/rand/ziggurat.zig @@ -131,7 +131,11 @@ fn norm_zero_case(random: *Random, u: f64) f64 { } } -test "ziggurant normal dist sanity" { +const please_windows_dont_oom = std.Target.current.os.tag == .windows; + +test "normal dist sanity" { + if (please_windows_dont_oom) return error.SkipZigTest; + var prng = std.rand.DefaultPrng.init(0); var i: usize = 0; while (i < 1000) : (i += 1) { @@ -158,7 +162,9 @@ fn exp_zero_case(random: *Random, _: f64) f64 { return exp_r - math.ln(random.float(f64)); } -test "ziggurant exp dist sanity" { +test "exp dist sanity" { + if (please_windows_dont_oom) return error.SkipZigTest; + var prng = std.rand.DefaultPrng.init(0); var i: usize = 0; while (i < 1000) : (i += 1) { @@ -166,6 +172,8 @@ test "ziggurant exp dist sanity" { } } -test "ziggurat table gen" { +test "table gen" { + if (please_windows_dont_oom) return error.SkipZigTest; + const table = NormDist; } -- 2.54.0