test(terminal): speed up history setup for pressure recovery (#10683)

Windows timed out while the fixture printed 12,050 rows before signaling readiness. Batch the initial writes and keep the live burst and replay assertions.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
This commit is contained in:
paseo-bot[bot] authored and GitHub committed 2026-11-24 12:01:34 +00:00
1 parent c626bf3707
commit 7bcd598f09
1 file changed
+11 -5
@@ -2594,14 +2594,20 @@ it.each([false, true])(
...nodeTerminalCommand(`
process.stdin.setRawMode(true);
let row = 0;
function print(count) {
for(let i=0;i<count;i++,row++) process.stdout.write("\\x1b[31mrow-" + String(row).padStart(5,"0") + " 界é🙂 " + "log ".repeat(20) + "\\x1b[0m\\r\\n");
function nextRow() {
return "\\x1b[31mrow-" + String(row++).padStart(5,"0") + " 界é🙂 " + "log ".repeat(20) + "\\x1b[0m\\r\\n";
}
// Fill the initial history in batches to avoid a TTY write for every row.
for (let start = 0; start < 12050; start += 256) {
const count = Math.min(256, 12050 - start);
process.stdout.write(Array.from({ length: count }, nextRow).join(""));
}
print(12050);
process.stdout.write("READY\\r\\n");
process.stdin.on("data", data => {
if(data.toString().includes("BURST")) { print(4000); process.stdout.write("BURST-DONE\\r\\n"); }
else process.stdout.write("ECHO:" + data.toString() + "\\r\\n");
if(data.toString().includes("BURST")) {
for (let i = 0; i < 4000; i++) process.stdout.write(nextRow());
process.stdout.write("BURST-DONE\\r\\n");
} else process.stdout.write("ECHO:" + data.toString() + "\\r\\n");
});
setInterval(()=>{},1000);
`),