You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is a bug report, please provide as much info as possible
version: 2.0.0
platform: Windows 10 > WSL2 > Ubuntu 22
expected behavior > the shell in the test command works fine
actual behavior > the shell's input is glitchy
When using a test program which has interactive shell, the interactive shell will behave in an erratic way: some characters are not registered on keypress. It's randomly about 50% chance that the character is written to the test process's stdin. The exact case I'm running is with the 'smashtest' package. It's not really relevant, but for completeness, here is my command line:
Smashtest is running a Node.js built-in REPL instance. I have debugged the problem and found that start-server-and-test uses stdio: 'inherit' on both the server and the test child processes, which doesn't make sense, as we can't control both. If I set the server to stdio: ['ignore', 'inherit', 'inherit'], the problem goes away.
I assume people didn't run into this problem because they either used this library with a non-interactive headless test session, or with a GUI test program.
The text was updated successfully, but these errors were encountered:
sarimarton
changed the title
stdin is glitchy with interactive test shells
Interactive shell in the test process is erratic due to stdin being piped to both the server and the test processes
Aug 9, 2023
Is this a bug report or a feature request?
Bug report
If this is a bug report, please provide as much info as possible
When using a test program which has interactive shell, the interactive shell will behave in an erratic way: some characters are not registered on keypress. It's randomly about 50% chance that the character is written to the test process's stdin. The exact case I'm running is with the 'smashtest' package. It's not really relevant, but for completeness, here is my command line:
start-test 'PORT=5001 npm start | dev-null' tcp:127.0.0.1:5001 'PORT=5001 smashtest tests/*.smash'
Smashtest is running a Node.js built-in REPL instance. I have debugged the problem and found that start-server-and-test uses
stdio: 'inherit'
on both the server and the test child processes, which doesn't make sense, as we can't control both. If I set the server tostdio: ['ignore', 'inherit', 'inherit']
, the problem goes away.I assume people didn't run into this problem because they either used this library with a non-interactive headless test session, or with a GUI test program.
I've made a PR which fixes the issue: #369
The text was updated successfully, but these errors were encountered: