From b904ff601d9b9069082f6a6ebaf3e277ef6dd09f Mon Sep 17 00:00:00 2001 From: Amanda Tarafa Mas Date: Thu, 11 Jun 2026 11:04:03 -0700 Subject: [PATCH 1/2] chore(Diagnostics): Add Common.IntegrationTests project to the AspNetCore3 solution. We reuse code from Commnon.IntegrationTests in AspNetCore3.IntegrationTests and this just makes it easier to change things at once. --- .../Google.Cloud.Diagnostics.AspNetCore3.sln | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.sln b/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.sln index d35d88ecc39f..1495407188ad 100644 --- a/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.sln +++ b/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.sln @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.ClientTesting" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.Diagnostics.Common", "..\Google.Cloud.Diagnostics.Common\Google.Cloud.Diagnostics.Common\Google.Cloud.Diagnostics.Common.csproj", "{2FA0133E-01FE-AA78-78FE-944CB8AEAEC3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.Diagnostics.Common.IntegrationTests", "..\Google.Cloud.Diagnostics.Common\Google.Cloud.Diagnostics.Common.IntegrationTests\Google.Cloud.Diagnostics.Common.IntegrationTests.csproj", "{23313188-9132-3B57-B751-A7557CE55247}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,8 +47,15 @@ Global {2FA0133E-01FE-AA78-78FE-944CB8AEAEC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FA0133E-01FE-AA78-78FE-944CB8AEAEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FA0133E-01FE-AA78-78FE-944CB8AEAEC3}.Release|Any CPU.Build.0 = Release|Any CPU + {23313188-9132-3B57-B751-A7557CE55247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23313188-9132-3B57-B751-A7557CE55247}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23313188-9132-3B57-B751-A7557CE55247}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23313188-9132-3B57-B751-A7557CE55247}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A4A5A2EC-9517-4CB1-8347-5D8FFE174AA9} + EndGlobalSection EndGlobal From 15171e9e5d32817fd6bbdb9d7ea36178866025c4 Mon Sep 17 00:00:00 2001 From: Amanda Tarafa Mas Date: Thu, 11 Jun 2026 11:08:14 -0700 Subject: [PATCH 2/2] tests(Diagnostics): Loosen some tests and poll for longer. We ocassionally see some flakes due to data freshness. --- .../Logging/LoggingTest.cs | 4 +++- .../ErrorReporting/ErrorEventEntryPolling.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests/Logging/LoggingTest.cs b/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests/Logging/LoggingTest.cs index fb8888e7c110..f4f27f449e9f 100644 --- a/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests/Logging/LoggingTest.cs +++ b/apis/Google.Cloud.Diagnostics.AspNetCore3/Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests/Logging/LoggingTest.cs @@ -102,7 +102,9 @@ public async Task Logging_ManyEntries() } _fixture.AddValidator(testId, results => { - Assert.Equal(1000, results.Count); + // We logged 1000 entries, but because of data freshness we sometimes se around 990, + // that's fine, let's expect more than 950. + Assert.InRange(results.Count, 950, 1000); Assert.All(results, l => { Assert.NotEqual(LogSeverity.Debug, l.Severity); diff --git a/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/ErrorReporting/ErrorEventEntryPolling.cs b/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/ErrorReporting/ErrorEventEntryPolling.cs index d1755c11cb49..e1b35e8cd344 100644 --- a/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/ErrorReporting/ErrorEventEntryPolling.cs +++ b/apis/Google.Cloud.Diagnostics.Common/Google.Cloud.Diagnostics.Common.IntegrationTests/ErrorReporting/ErrorEventEntryPolling.cs @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ private ErrorEventEntryPolling(TimeSpan? timeout, TimeSpan? sleepInterval) : base(timeout, sleepInterval) { } - public static ErrorEventEntryPolling Default { get; } = new ErrorEventEntryPolling(null, null); + public static ErrorEventEntryPolling Default { get; } = new ErrorEventEntryPolling(TimeSpan.FromMinutes(15), null); public static ErrorEventEntryPolling NoRetry { get; } = new ErrorEventEntryPolling(TimeSpan.Zero, TimeSpan.Zero);