Skip to content

Commit

Permalink
✅ harden interleaved io test a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffynuts committed Mar 15, 2024
1 parent 6b3d3cd commit 5754d8a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions source/Utils/PeanutButter.Utils.Tests/TestProcessIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,25 @@ public void ShouldBeAbleToReadInterleavedIo()
{
// Arrange
// Act
using var tempFile = new AutoTempFile(@"
(async () => {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
console.log('stdout 1');
await sleep(1);
console.error('stderr 1');
await sleep(1);
console.error('stdout 2');
await sleep(1);
console.log('stderr 2');
})();
");
using var io = ProcessIO
.Start(
"node",
"-e",
"console.log('stdout 1');console.error('stderr 1');console.error('stderr 2');console.log('stdout 2');"
tempFile.Path
);
io.WaitForExit();
// Assert
Expand Down

0 comments on commit 5754d8a

Please sign in to comment.