diff --git a/tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerFixtures/LinuxSmokeTestFixtures.cs b/tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerFixtures/LinuxSmokeTestFixtures.cs index 06f49d9cac..d8e2aef9c3 100644 --- a/tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerFixtures/LinuxSmokeTestFixtures.cs +++ b/tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerFixtures/LinuxSmokeTestFixtures.cs @@ -1,6 +1,8 @@ // Copyright 2020 New Relic, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +using System; +using System.Threading.Tasks; using Xunit; namespace NewRelic.Agent.ContainerIntegrationTests.ContainerFixtures; @@ -19,6 +21,11 @@ public virtual void ExerciseApplication() var address = $"http://localhost:{Port}/weatherforecast"; GetAndAssertStatusCode(address, System.Net.HttpStatusCode.OK); } + + public void Delay(int seconds) + { + Task.Delay(TimeSpan.FromSeconds(seconds)).GetAwaiter().GetResult(); + } } public class DebianX64SmokeTestFixture : LinuxSmokeTestFixtureBase diff --git a/tests/Agent/IntegrationTests/ContainerIntegrationTests/LinuxSmokeTests.cs b/tests/Agent/IntegrationTests/ContainerIntegrationTests/LinuxSmokeTests.cs index dd1e564b0d..606be501f7 100644 --- a/tests/Agent/IntegrationTests/ContainerIntegrationTests/LinuxSmokeTests.cs +++ b/tests/Agent/IntegrationTests/ContainerIntegrationTests/LinuxSmokeTests.cs @@ -21,14 +21,15 @@ protected LinuxSmokeTest(T fixture, ITestOutputHelper output) : base(fixture) _fixture.Actions(setupConfiguration: () => { var configModifier = new NewRelicConfigModifier(_fixture.DestinationNewRelicConfigFilePath); - configModifier.ConfigureFasterMetricsHarvestCycle(5); + configModifier.ConfigureFasterMetricsHarvestCycle(10); configModifier.LogToConsole(); }, exerciseApplication: () => { _fixture.ExerciseApplication(); - _fixture.AgentLog.WaitForLogLine(AgentLogBase.HarvestFinishedLogLineRegex, TimeSpan.FromSeconds(10)); + _fixture.Delay(11); // wait long enough to ensure a metric harvest occurs after we exercise the app + _fixture.AgentLog.WaitForLogLine(AgentLogBase.HarvestFinishedLogLineRegex, TimeSpan.FromSeconds(11)); // shut down the container and wait for the agent log to see it _fixture.ShutdownRemoteApplication();