Skip to content

Commit

Permalink
test: Fix lambda smoke test flicker. (#2521)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrcventura committed Jun 3, 2024
1 parent 5f5f9fc commit fb2434e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ protected AwsLambdaSmokeTestBase(string expectedTransactionName, T fixture, ITes

_fixture = fixture;
_fixture.TestLogger = output;

_fixture.AdditionalSetupConfiguration = () =>
{
var configPath = fixture.DestinationNewRelicConfigFilePath;
var configModifier = new NewRelicConfigModifier(configPath);
configModifier.ForceTransactionTraces();
};

_fixture.Actions(
exerciseApplication: () =>
{
Expand Down Expand Up @@ -51,8 +59,8 @@ public void Test()
() => Assert.NotNull(serverlessPayload.Telemetry.MetricsPayload),
() => Assert.NotNull(serverlessPayload.Telemetry.TransactionEventsPayload),
() => Assert.NotNull(serverlessPayload.Telemetry.SpanEventsPayload),
() => Assert.NotNull(serverlessPayload.Telemetry.TransactionTracePayload),
() => Assert.Null(serverlessPayload.Telemetry.SqlTracePayload),
() => Assert.Null(serverlessPayload.Telemetry.TransactionTracePayload),
() => Assert.Null(serverlessPayload.Telemetry.ErrorTracePayload),
() => Assert.Null(serverlessPayload.Telemetry.ErrorEventsPayload),
() => Assert.Equal(_expectedTransactionName, serverlessPayload.Telemetry.TransactionEventsPayload.TransactionEvents.Single().IntrinsicAttributes["name"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace NewRelic.Agent.IntegrationTests.RemoteServiceFixtures.AwsLambda
public class LambdaTestToolFixture : RemoteApplicationFixture
{
public DotnetTool LambdaTestTool { get; set; }
public Action AdditionalSetupConfiguration { get; set; }

public LambdaTestToolFixture(RemoteApplication remoteApplication, string newRelicLambdaHandler, string lambdaHandler, string lambdaName, string lambdaVersion, string lambdaExecutionEnvironment) : base(remoteApplication)
{
Expand Down Expand Up @@ -41,6 +42,8 @@ public LambdaTestToolFixture(RemoteApplication remoteApplication, string newReli
// Finest level logs are necessary to read the uncompressed payloads from the agent logs
remoteApplication.NewRelicConfig.SetLogLevel("finest");
AdditionalSetupConfiguration?.Invoke();
if (LambdaTestTool.IsRunning)
{
return;
Expand Down

0 comments on commit fb2434e

Please sign in to comment.