diff --git a/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore.IntegrationTests/ErrorReporting/ErrorReportingTest.cs b/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore.IntegrationTests/ErrorReporting/ErrorReportingTest.cs index a6bc776a1de7..a2a242dc1399 100644 --- a/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore.IntegrationTests/ErrorReporting/ErrorReportingTest.cs +++ b/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore.IntegrationTests/ErrorReporting/ErrorReportingTest.cs @@ -46,17 +46,6 @@ public ErrorReportingTest() _client = _server.CreateClient(); } - [Fact] - public async Task NoExceptions() - { - var response = await _client.GetAsync($"/ErrorReporting/{nameof(ErrorReportingController.Index)}/{_testId}"); - - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - - var errorEvents = s_polling.GetEvents(_testId, 0); - Assert.Empty(errorEvents); - } - [Fact] public async Task ManualLog() { diff --git a/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/BaseEntryPolling.cs b/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/BaseEntryPolling.cs index 1be16ccf30be..76999117d413 100644 --- a/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/BaseEntryPolling.cs +++ b/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/BaseEntryPolling.cs @@ -62,13 +62,16 @@ protected IEnumerable GetEntries(int minEntries, Func> getEntr totalSleepTime += sleepTime; Thread.Sleep(sleepTime); - IEnumerable entries = getEntries(); - if (minEntries == 0 || entries.Count() >= minEntries) + List entries = getEntries().ToList(); + if (entries.Count >= minEntries) { return entries; } } - return new List(); + // We don't throw an exception here, as even if we've been asked for some entries, it may be that + // we're in a situation of expecting at least one of a few polls to succeed, and we just wanted to + // try hard to find it. + return Enumerable.Empty(); } } }