mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
reduce test wait time
This commit is contained in:
@@ -62,8 +62,8 @@ pub fn getRSS() i64 {
|
|||||||
const data = writer.written();
|
const data = writer.written();
|
||||||
const index = std.mem.indexOf(u8, data, "rss: ") orelse return -1;
|
const index = std.mem.indexOf(u8, data, "rss: ") orelse return -1;
|
||||||
const sep = std.mem.indexOfScalarPos(u8, data, index + 5, ' ') orelse return -2;
|
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 value = std.fmt.parseFloat(f64, data[index + 5 .. sep]) catch return -3;
|
||||||
const unit = data[sep+1..];
|
const unit = data[sep + 1 ..];
|
||||||
if (std.mem.startsWith(u8, unit, "KiB,")) {
|
if (std.mem.startsWith(u8, unit, "KiB,")) {
|
||||||
return @as(i64, @intFromFloat(value)) * 1024;
|
return @as(i64, @intFromFloat(value)) * 1024;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,7 +353,8 @@ pub const Page = struct {
|
|||||||
std.debug.assert(http_client.intercepted == 0);
|
std.debug.assert(http_client.intercepted == 0);
|
||||||
|
|
||||||
const ms = ms_to_next_task orelse blk: {
|
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
|
// Look, we want to exit ASAP, but we don't want
|
||||||
// to exit so fast that we've run none of the
|
// to exit so fast that we've run none of the
|
||||||
// background jobs.
|
// background jobs.
|
||||||
|
|||||||
Reference in New Issue
Block a user