Skip to content

Commit 259d478

Browse files
authored
Try to catch memory dump for instrumentation telemetry tests (#6675)
## Summary of changes Try to grab a memory dump if `dotnet build` fails as part of the instrumentation tests ## Reason for change Since updating to 9.0.102, we've seen cases of the `dotnet build` hanging on arm64. In this test we explicitly build a "forwarder" app, and that has a hung several times in CI now. ## Implementation details Use the memory dump helper to try to grab a dump. We've only seen this happen on linux arm64 so far, so haven't bothered to hook up the Windows monitoring or anything like that ## Test coverage If the tests pass, that's good enough for me until we see this flake manifest again.
1 parent d2ae16e commit 259d478

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/InstrumentationTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,14 @@ public string GetAppPath(ITestOutputHelper output, EnvironmentHelper environment
606606
RedirectStandardError = true,
607607
};
608608
using var process = new ProcessHelper(Process.Start(startInfo), x => output.WriteLine(x), x => output.WriteLine(x));
609-
process.Process.WaitForExit(30_000);
609+
const int timeoutMs = 30_000;
610+
if (!process.Process.WaitForExit(timeoutMs))
611+
{
612+
var tookMemoryDump = MemoryDumpHelper.CaptureMemoryDump(process.Process, includeChildProcesses: true);
613+
process.Process.Kill();
614+
throw new Exception($"The sample did not exit in {timeoutMs}ms. Memory dump taken: {tookMemoryDump}. Killing process.");
615+
}
616+
610617
process.Drain(15_000);
611618

612619
var extension = EnvironmentTools.IsWindows() ? ".exe" : string.Empty;

0 commit comments

Comments
 (0)