33 lines
1.2 KiB
JSON
33 lines
1.2 KiB
JSON
{
|
|
"name": "restart_process_keeps_chrome",
|
|
"cols": 120,
|
|
"rows": 40,
|
|
"scripts": [
|
|
{
|
|
"name": "slow-restart",
|
|
"body": "#!/bin/sh\ncount_file=\"$XDG_RUNTIME_DIR/slow-restart-count\"\nif [ -f \"$count_file\" ]; then\n n=$(cat \"$count_file\")\nelse\n n=0\nfi\nn=$((n + 1))\nprintf '%s\\n' \"$n\" > \"$count_file\"\nprintf 'SLOW READY %s\\n' \"$n\"\ntrap 'sleep 3; exit 0' TERM\nwhile true; do sleep 1; done\n"
|
|
}
|
|
],
|
|
"steps": [
|
|
{
|
|
"type": "mcp_call",
|
|
"method": "spawn_process",
|
|
"params": { "kind": "command", "argv": ["slow-restart"], "name": "slow-restart" },
|
|
"save_as": "spawned"
|
|
},
|
|
{
|
|
"type": "mcp_call",
|
|
"method": "select_process",
|
|
"params": { "process_id": "{{spawned.process_id}}" }
|
|
},
|
|
{ "type": "wait_text", "contains": "SLOW READY 1", "timeout_ms": 5000 },
|
|
{ "type": "wait_stable", "timeout_ms": 2000 },
|
|
{ "type": "assert_contains", "contains": "Processes" },
|
|
{ "type": "send_text", "text": "\u000brestart\r" },
|
|
{ "type": "wait_stable", "timeout_ms": 2000 },
|
|
{ "type": "assert_contains", "contains": "Processes" },
|
|
{ "type": "assert_contains", "contains": "slow-restart" },
|
|
{ "type": "wait_text", "contains": "SLOW READY 2", "timeout_ms": 7000 }
|
|
]
|
|
}
|