test(console): make ConsoleInputPump prompt tests deterministic

Replace Thread.Sleep-based synchronization with waits on real state
(HasPendingPrompt / reader call count) so the rendezvous tests no longer
race on slow CI runners (CentOS 9, Ubuntu 22, macOS 15/26).
This commit is contained in:
Kamron Batman 2026-07-15 23:31:25 -07:00
parent 9cced198f9
commit 6a3ab5d93a
2 changed files with 44 additions and 12 deletions

View file

@ -35,6 +35,19 @@ internal sealed class ConsoleInputPump
public bool Running => _running;
// Test-observable: true while a ReadLine() caller is registered and waiting for the
// next line. Lets tests synchronize on the rendezvous state instead of sleeping.
internal bool HasPendingPrompt
{
get
{
lock (_gate)
{
return _promptPending;
}
}
}
public void Run()
{
try