summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/replicas.zig20
1 files changed, 8 insertions, 12 deletions
diff --git a/test/replicas.zig b/test/replicas.zig
index 5cddf6c8..e0e8b601 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -330,7 +330,7 @@ const Totals = struct {
/// search (`/`, a pattern, Enter), a sweep of B1 over the PDF and its
/// wheel; a yank to the system clipboard and a paste from it; now and
/// then a client's Detach.
-fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const u8, script: *Script) pardes.Event {
+fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const u8, script: *Script, far: bool) pardes.Event {
const typed = "abcdefghijklmnopqrstuvwxyz0123456789 -_=+,:;()";
const normal = "hjklwbe0$xpuyoOiaAIdcv.nN%sC";
if (script.at < script.n) {
@@ -374,8 +374,9 @@ fn nextEvent(random: std.Random, buf: *[64]u8, aim: Aim, looks: []const []const
10 => "Tab 8",
11 => "Life",
// Its link ended by the session (the session's own view's,
- // its terminal's: none here).
- 12 => if (random.uintLessThan(u8, 4) == 0) "Detach" else "Undo",
+ // its terminal's: none here). Not the far client's: the scene
+ // waits for its screen after the flood.
+ 12 => if (random.uintLessThan(u8, 4) == 0 and !far) "Detach" else "Undo",
// The system clipboard, the client's own frontend's (client.zig
// `asks`): a yank of the selection to it, a paste from it.
13 => "ClipYank",
@@ -1504,7 +1505,7 @@ const Soak = struct {
switch (m.kind) {
.input => {
var buf: [64]u8 = undefined;
- const ev = nextEvent(s.random, &buf, s.aim, s.looks, &cl.script);
+ const ev = nextEvent(s.random, &buf, s.aim, s.looks, &cl.script, net.throttled == @as(?usize, c));
cl.loop.input(ev);
cl.left -= 1;
if (cl.left > 0) try net.send(.{ .at = m.at + typistGap(s.random), .n = 0, .kind = .input, .who = m.who, .bytes = &.{} }) else {
@@ -1576,7 +1577,7 @@ const Soak = struct {
const core = s.l.core;
s.clock();
var buf: [64]u8 = undefined;
- const ev = nextEvent(s.random, &buf, s.aim, s.looks, &s.own_script);
+ const ev = nextEvent(s.random, &buf, s.aim, s.looks, &s.own_script, false);
core.toView(.at(0));
core.update(ev);
s.own_left -= 1;
@@ -1653,6 +1654,7 @@ const Soak = struct {
const want = pardes.tape.digestOf(core);
totals.cut += s.l.peers.cut;
if (bytes_kind) std.debug.print("seed {d} rtt {d} ms: a join's step at worst {d} us (the session's reloads and its dump), the last dump {d} KB ({d} KB of state)\n", .{ s.r.seed, s.r.rtt_ms, s.join_worst / 1000, s.l.peers.dump_bytes >> 10, s.l.peers.state_bytes >> 10 });
+ if (s.net.throttled) |c| if (!s.far_final) std.debug.print("seed {d} rtt {d} ms: the far client never showed the screen after the flood ({s})\n", .{ s.r.seed, s.r.rtt_ms, if (s.clients[c].r == null) "it left" else "it is joined" });
if (bytes_kind and s.kitty_answers != 1) {
totals.unequal += 1;
std.debug.print("seed {d} rtt {d} ms: the program's kitty query was answered {d} times on the session's pty\n", .{ s.r.seed, s.r.rtt_ms, s.kitty_answers });
@@ -1824,13 +1826,7 @@ fn catAfter(before: []const u8, n: usize) ![]u8 {
try out.appendSlice(gpa, before);
while (out.items.len < before.len + n) {
var lines = std.mem.splitScalar(u8, @embedFile("replicas.zig"), '\n');
- // Its lines of ASCII: one with a wide character, the scrollback
- // reloaded at joins between reflows, still parts a client from the
- // session (reports/pardes-term-lag.md), a fault of its own.
- next: while (lines.next()) |line| {
- for (line) |ch| if (ch >= 0x80) continue :next;
- try out.print(gpa, "{s}\r\n", .{line});
- }
+ while (lines.next()) |line| try out.print(gpa, "{s}\r\n", .{line});
}
out.shrinkRetainingCapacity(before.len + n);
return out.toOwnedSlice(gpa);