Skip to content

Commit 3a0a930

Browse files
committed
don't log 'long timeout ignored' during testing
1 parent c40704d commit 3a0a930

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/html/window.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ pub const Window = struct {
273273
fn createTimeout(self: *Window, cbk: Function, delay_: ?u32, page: *Page, opts: CreateTimeoutOpts) !u32 {
274274
const delay = delay_ orelse 0;
275275
if (delay > 5000) {
276-
log.warn(.user_script, "long timeout ignored", .{ .delay = delay, .interval = opts.repeat });
276+
if (!@import("builtin").is_test) {
277+
log.warn(.user_script, "long timeout ignored", .{ .delay = delay, .interval = opts.repeat });
278+
}
277279
// self.timer_id is u30, so the largest value we can generate is
278280
// 1_073_741_824. Returning 2_000_000_000 makes sure that clients
279281
// can call cancelTimer/cancelInterval without breaking anything.

0 commit comments

Comments
 (0)