Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
FailFast in System.ConsolePal.WindowsConsoleStream.WriteFileNative #24508
While debugging OpenCover, which invoked xunit.console, if I select in the console (to block console output) I sometimes get a failfast as below.
In this case, writeSuccess is true, but count == 50 and numBytesWritten is 100. The string to write is 50 characters: "xUnit.net console test runner (64-bit .NET Core).\n". MSDN seems clear that count is in bytes, however. Note: this is on RS3.
Of course, this is the reverse situation but perhaps the assert would fail in this case also. I assume that WriteFile wants you to call it again for the remainder in this case (which we don't do)
In the case where count > numBytesWritten,
are we supposed to call WriteFile again (with an incremented pointer/lower count)? I'm not sure what else it would mean, since we can't just carry on and let it read more from our buffer at an arbitrary future time.
referenced this issue
Oct 9, 2017
Yes, that's how it usually works. However, I doubt that it is needed here, note that the MSDN doc refers to pipes opened in non-blocking mode, that's a very unusual case.
It's also a very different situation than the issue you're experiencing.
Agreed, although interestingly we recently hit upon that situation on Linux in a docker container, and needed to add explicit blocking to address it.