Skip to content

Commit 45b8524

Browse files
committed
Merge remote-tracking branch 'origin/main' into ci/parallel-integration-tests
2 parents 762a4da + d63e16a commit 45b8524

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMEnabledTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
using System.Collections.Generic;
6-
using System.Linq;
76
using NewRelic.Agent.IntegrationTestHelpers;
87
using NewRelic.Agent.Tests.TestSerializationHelpers.Models;
98
using NewRelic.Testing.Assertions;
@@ -84,7 +83,7 @@ public void Test()
8483
};
8584

8685

87-
var transactionSample = _fixture.AgentLog.GetTransactionSamples().FirstOrDefault();
86+
var transactionSample = _fixture.AgentLog.TryGetTransactionSample("WebTransaction/MVC/Home/Query/{data}");
8887
var getDataTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/Home/Query/{data}");
8988
var getExceptionTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/Home/ThrowException");
9089

@@ -104,4 +103,4 @@ public void Test()
104103
() => Assertions.TransactionEventHasAttributes(expectedErrorTransactionEventAttributes, TransactionEventAttributeType.Intrinsic, getExceptionTransactionEvent)
105104
);
106105
}
107-
}
106+
}

tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeDisabled.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void Test()
7474

7575
var displayHost = _fixture.AgentLog.GetConnectData().DisplayHost;
7676
var getDataTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/DefaultController/Query");
77-
var transactionSample = _fixture.AgentLog.GetTransactionSamples().FirstOrDefault();
77+
var transactionSample = _fixture.AgentLog.TryGetTransactionSample("WebTransaction/MVC/DefaultController/Query");
7878
var errorEvents = _fixture.AgentLog.GetErrorEvents().ToList();
7979
var errorTraces = _fixture.AgentLog.GetErrorTraces().ToList();
8080
var firstErrorEvent = errorEvents.FirstOrDefault();

tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeEnabled.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void Test()
104104
const string originalErrorMessage = "!Exception~Message!";
105105

106106
var displayHost = _fixture.AgentLog.GetConnectData().DisplayHost;
107-
var transactionSample = _fixture.AgentLog.GetTransactionSamples().FirstOrDefault();
107+
var transactionSample = _fixture.AgentLog.TryGetTransactionSample("WebTransaction/MVC/DefaultController/Query");
108108
var getDataTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/DefaultController/Query");
109109
var getExceptionTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/DefaultController/ThrowException");
110110

tests/Agent/IntegrationTests/IntegrationTests/CSP/SecurityPoliciesMostRestrictiveTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void Test()
9191

9292
const string originalErrorMessage = "!Exception~Message!";
9393

94-
var transactionSample = _fixture.AgentLog.GetTransactionSamples().FirstOrDefault();
94+
var transactionSample = _fixture.AgentLog.TryGetTransactionSample("WebTransaction/MVC/DefaultController/Query");
9595
var getDataTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/DefaultController/Query");
9696
var getExceptionTransactionEvent = _fixture.AgentLog.TryGetTransactionEvent("WebTransaction/MVC/DefaultController/ThrowException");
9797

tests/Agent/IntegrationTests/IntegrationTests/RemoteServiceFixtures/AwsLambda/LambdaTestToolFixture.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ private void AddAdditionalEnvironmentVariableIfNotNull(string name, string value
7878

7979
private void WarmUpTestTool()
8080
{
81+
const int maxAttempts = 5;
8182

82-
for (var attempt = 1; attempt <= 3; attempt++)
83+
// Give the tool a moment to start listening before the first probe
84+
Thread.Sleep(TimeSpan.FromSeconds(5));
85+
86+
for (var attempt = 1; attempt <= maxAttempts; attempt++)
8387
{
8488
try
8589
{
@@ -93,7 +97,7 @@ private void WarmUpTestTool()
9397
catch (Exception e)
9498
{
9599
TestLogger?.WriteLine($"Unable to warm up lambda test tool during attempt {attempt}. Exception: {e}");
96-
if (attempt == 3)
100+
if (attempt == maxAttempts)
97101
{
98102
// Halt the test because the test tool was unable to start
99103
throw;

0 commit comments

Comments
 (0)