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:
parent
9cced198f9
commit
6a3ab5d93a
2 changed files with 44 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue