mirror of
https://github.com/coder/coder.git
synced 2026-06-06 06:28:20 +00:00
45475b803e
The subtest previously called session.Shell(), wrote "exit 0" through a client-side PTY, and then waited indefinitely on session.Wait(). Under the race detector the byte stream occasionally arrived at the agent before the remote shell was in its read loop and was silently discarded; the shell never exited, session.Wait() blocked until the go-test watchdog kicked in and killed the test binary. The agent writes the message of the day announcement banner synchronously in agentssh.startPTYSession before forking the user shell. The subtest now repeatedly sends "exit 0" and the writes/waiting on session.Wait are time bound. Also fixes a pre-existing test bug where the empty bytes intended to create ~/.hushlogin were written to the MOTD path. The previous test passed only because the MOTD file ended up empty, not because the hushlogin code path was exercised. With the file now placed at the correct path, the assertion genuinely validates isQuietLogin. Generated with assistance from Coder Agents.