Skip to content

Commit

Permalink
std: disable a couple tests on windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewrk committed Jan 2, 2021
1 parent 5a65796 commit 44c9bf5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
10 changes: 10 additions & 0 deletions lib/std/hash/crc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
14 changes: 11 additions & 3 deletions lib/std/rand/ziggurat.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -158,14 +162,18 @@ 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) {
_ = prng.random.floatExp(f64);
}
}

test "ziggurat table gen" {
test "table gen" {
if (please_windows_dont_oom) return error.SkipZigTest;

const table = NormDist;
}

0 comments on commit 44c9bf5

Please sign in to comment.