Lux gets stuck and do not terminate the test when using build-in `tail`
Hello Håkan 👋
I have an interesting problem with the test that seems to hang completely when I inspect the output with the built-in tail command. It doesn't seem to pass the ok macro (that you could find below) that checks if the program has terminated with a non-zero code, while this program may run for some time (a couple of minutes).
Surprisingly, when I do not check the output with tail, the problem doesn't happen, and the test passes.
I wonder if you have any ideas what might be causing that, or how I can further investigate
System Info:
Apple M3, Sequoia 15.5
erl --version
Erlang/OTP 25 [erts-13.2.2.4]
lux --version
2.9.1
The output of the tail follows:
multiple recv RELATIVELY LONG INPUT HERE
...
5:05:28.347857 test(430): recv "---> Successfully setup ........\n"
15:05:28.350586 test(430): recv "SH-PROMPT:0 "
15:05:28.350671 test(430): timer canceled (after 204003909 microseconds)
15:05:28.351238 test(430): skip "\r\n RELATIVELY LONG INPUT HERE\n---> Successfully setup ........\n
15:05:28.351238 test(430): match "SH-PROMPT:0 "
15:05:28.351238 test(430): rest ""
And block there.. If I attempt to interrupt the test:
q
WARNING: Test case stopped by user
The warning is printed, but nothing happens. Following enter or q, doesn't help:
WARNING: Test case stopped by user
q
WARNING: Test case stopped by user
The only way to terminate is just Ctrl + C.
The way matching on the SH-PROMPT is implemented with the following macro:
[global exit_code_zero=SH-PROMPT:0\s]
...
[macro ok]
?${exit_code_zero}
[endmacro]