{"record":{"id":"9ef45e6c1822b852","repo":"dotnet/reactive","slug":"did-not-get-output-from-program","errorCode":null,"errorMessage":"Did not get output from program","messagePattern":"Did not get output from program","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Test/Gauntlet/Checks/PlugIns/PlugIn.HostDriver/PlugInHost.cs","lineNumber":155,"sourceCode":"        var resultTask = stdOutStreamToResult(process.StandardOutput.BaseStream);\n        var processTask = process.WaitForExitAsync();\n        var firstToFinish = await Task.WhenAny(processTask, resultTask);\n\n        if (process.HasExited && process.ExitCode != 0)\n        {\n            Console.WriteLine($\"{plugInHostExecutablePath} exited with code {process.ExitCode} for args {startInfo.Arguments}\");\n        }\n\n        if (!resultTask.IsCompleted)\n        {\n            // The process finished, but the result task is still running. It's possible that\n            // it is nearly done, so give it some time.\n            await Task.WhenAny(resultTask, Task.Delay(2000));\n        }\n\n        if (!resultTask.IsCompleted)\n        {\n            throw new InvalidOperationException(\"Did not get output from program\");\n        }\n        var result = await resultTask;\n\n        return result;\n    }\n}\n","sourceCodeStart":137,"sourceCodeEnd":162,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Test/Gauntlet/Checks/PlugIns/PlugIn.HostDriver/PlugInHost.cs#L137-L162","documentation":"After launching the plug-in host process, PlugInHost.Run waits in a loop (with Task.WhenAny against Task.Delay(2000)) for the process's output task to complete. If output never completes, it throws InvalidOperationException('Did not get output from program'). This means the child process hung, crashed without closing stdout, or never produced its completion output within the polling loop's patience.","triggerScenarios":"The spawned PlugIn.Host process fails to write its expected output to stdout/stderr before the polling loop gives up; the process hangs indefinitely or is blocked waiting for input.","commonSituations":"A plug-in deadlocks at load; the host exe crashes early so no output ever arrives; console redirection issues; extremely slow first-run ( NuGet restore, JIT ) exceeding the wait loop.","solutions":["Reproduce and run the PlugIn.Host exe manually with the same arguments to see why it produces no output","Check the plug-in DLLs for load-time deadlocks or blocking static initializers","Increase the polling timeout if the process is legitimately slow","Verify the host process is not waiting on stdin or a missing file at startup"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"using var p = Process.Start(startInfo);\n// ensure the exe starts before relying on output\nif (p is null || p.HasExited) throw new InvalidOperationException(\"Host process failed to start\");","typeGuard":"bool CompletedWithin(Task t, int ms) => Task.WaitAny(new[]{t}, ms) != -1;","tryCatchPattern":"try\n{\n    var result = await plugInHost.Run(...);\n}\ncatch (InvalidOperationException ex) when (ex.Message == \"Did not get output from program\")\n{\n    // kill hung child process, capture dump/logs, mark scenario failed\n}","preventionTips":["Keep plug-in static initializers non-blocking to avoid load deadlocks","Test the host exe manually before running it through the harness","Avoid console stdin waits in hosted processes","Use generous but finite timeouts with explicit process kill on expiry"],"tags":["process","timeout","stdout","test-harness"],"backgroundTag":"request-timeout","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}