// Currently Inspect.Heap/MemoryGraph does not promise to always work as expected if GCs happen // during its operation. So for now we retry in the tests. private static async Task <SlowUpdateResult <ExecutionResultData> > SendSlowUpdateWithRetryOnMovedObjectsAsync(MirrorSharpTestDriver driver) { var result = await driver.SendSlowUpdateAsync <ExecutionResultData>(); var tryCount = 1; while (result.JoinErrors().Contains("Failed to find object type for address") && tryCount < 10) { result = await driver.SendSlowUpdateAsync <ExecutionResultData>(); tryCount += 1; } return(result !); }
// Currently Inspect.Heap/MemoryGraph does not promise to always work as expected if GCs happen // during its operation. So for now we retry in the tests. private async Task <SlowUpdateResult <ExecutionResultData> > SendSlowUpdateWithRetryOnMovedObjectsAsync(MirrorSharpTestDriver driver) { var result = await driver.SendSlowUpdateAsync <ExecutionResultData>(); var tryCount = 1; while ((result.ExtensionResult?.GetOutputAsString().Contains("Failed to find object type for address") ?? false) && tryCount < 10) { _output.WriteLine($"Failed to find object type for address, retrying ({tryCount}) ..."); result = await driver.SendSlowUpdateAsync <ExecutionResultData>(); tryCount += 1; } return(result !); }
private static async Task <SlowUpdateDiagnosticAction> ExecuteSlowUpdateAndGetDiagnosticActionAsync( MirrorSharpTestDriver driver, string diagnosticMessageFilter, string actionTitleFilter ) { var result = await driver.SendSlowUpdateAsync(); var diagnostic = result.Diagnostics.Single(d => d.Message?.Contains(diagnosticMessageFilter) ?? false); return(diagnostic.Actions.Single(a => a.Title?.Contains(actionTitleFilter) ?? false)); }