From 60f1b1160e9aa4da3cc8cd0d4864423a06b33c65 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Tue, 23 Sep 2025 11:47:32 +0800 Subject: [PATCH] reduce test wait time --- src/browser/mimalloc.zig | 4 ++-- src/browser/page.zig | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/browser/mimalloc.zig b/src/browser/mimalloc.zig index 4e2dea28..d396a642 100644 --- a/src/browser/mimalloc.zig +++ b/src/browser/mimalloc.zig @@ -62,8 +62,8 @@ pub fn getRSS() i64 { const data = writer.written(); const index = std.mem.indexOf(u8, data, "rss: ") orelse return -1; const sep = std.mem.indexOfScalarPos(u8, data, index + 5, ' ') orelse return -2; - const value = std.fmt.parseFloat(f64, data[index+5..sep]) catch return -3; - const unit = data[sep+1..]; + const value = std.fmt.parseFloat(f64, data[index + 5 .. sep]) catch return -3; + const unit = data[sep + 1 ..]; if (std.mem.startsWith(u8, unit, "KiB,")) { return @as(i64, @intFromFloat(value)) * 1024; } diff --git a/src/browser/page.zig b/src/browser/page.zig index d253adc3..7c18130d 100644 --- a/src/browser/page.zig +++ b/src/browser/page.zig @@ -353,7 +353,8 @@ pub const Page = struct { std.debug.assert(http_client.intercepted == 0); const ms = ms_to_next_task orelse blk: { - if (wait_ms - ms_remaining < 100) { + const min_wait = if (comptime builtin.is_test) 5 else 100; + if (wait_ms - ms_remaining < min_wait) { // Look, we want to exit ASAP, but we don't want // to exit so fast that we've run none of the // background jobs.