Skip to content

Commit 50dfa33

Browse files
committed
fix: TooManyTypes test OOMs under -Dpreset=stress's 512-object cap
The pre-push hook's -Dpreset=stress lane (256KB heap, max_objects=512) caught what the earlier -Dpreset=1m verification couldn't: declaring 1025 type objects hit OutOfMemory well before the TooManyTypes=1024 ceiling this test targets. Gives this one test an explicit, generous heap/object budget via initWithConfig directly instead of setup()'s ambient preset-derived limits.
1 parent 7cf49bf commit 50dfa33

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/compiler_test.zig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6337,8 +6337,16 @@ test "task: five concurrently-ready tasks reply in spawn (FIFO) order" {
63376337
// interfaces are the cheapest declaration that still counts toward the
63386338
// shared counter.
63396339
test "compiler: declaring more than MaxTypes named types is rejected (TooManyTypes)" {
6340-
var rt = try setup();
6340+
var rt: Runtime = .{};
63416341
defer rt.deinit();
6342+
// Explicit, generous heap/object budget instead of setup()'s ambient
6343+
// preset: -Dpreset=stress (a CI lane, see config_stress.zig) caps
6344+
// max_objects at 512, far below the 1025 type objects this test
6345+
// declares — under that preset the run hit OutOfMemory before ever
6346+
// reaching the TooManyTypes check this test targets. Found by the
6347+
// pre-push hook's -Dpreset=stress lane, which the earlier -Dpreset=1m
6348+
// verification never exercised.
6349+
try rt.initWithConfig(.{ .allow_io = false }, 4 * 1024 * 1024, 4096, vms.MaxStack, vms.MaxFrames, cfg.max_defers, std.testing.allocator);
63426350
var src: std.ArrayListUnmanaged(u8) = .empty;
63436351
defer src.deinit(std.testing.allocator);
63446352
var i: u32 = 0;

0 commit comments

Comments
 (0)