Skip to content

Commit 50fbaf3

Browse files
committed
Fix merge compilation issue.
1 parent 7c44dac commit 50fbaf3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.IntegrationTests/ApiGatewayEmulatorProcessTests.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,13 @@ public async Task TestLambdaWithNullEndpoint()
227227

228228
try
229229
{
230-
StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode.HttpV2, Constants.DefaultApiGatewayEmulatorPort, config, cancellationTokenSource);
231-
await WaitForGatewayHealthCheck(Constants.DefaultApiGatewayEmulatorPort);
232-
await StartLambdaProcess(config, Constants.DefaultLambdaEmulatorPort);
230+
const int lambdaPort = 5060;
231+
const int apiGatewayPort = 5061;
232+
StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode.HttpV2, lambdaPort, apiGatewayPort, config, cancellationTokenSource);
233+
await WaitForGatewayHealthCheck(apiGatewayPort);
234+
await StartLambdaProcess(config, lambdaPort);
233235

234-
var response = await TestEndpoint(config, Constants.DefaultApiGatewayEmulatorPort );
236+
var response = await TestEndpoint(config, apiGatewayPort);
235237
var responseContent = await response.Content.ReadAsStringAsync();
236238

237239
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -264,7 +266,7 @@ private async Task<HttpResponseMessage> TestEndpoint(TestConfig config, int apiG
264266
};
265267
}
266268

267-
private void StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode apiGatewayMode, int apiGatewayPort, TestConfig config, CancellationTokenSource cancellationTokenSource)
269+
private void StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode apiGatewayMode, int lambdaPort, int apiGatewayPort, TestConfig config, CancellationTokenSource cancellationTokenSource)
268270
{
269271
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
270272
Environment.SetEnvironmentVariable("APIGATEWAY_EMULATOR_ROUTE_CONFIG", $@"{{
@@ -273,8 +275,8 @@ private void StartTestToolProcessWithNullEndpoint(ApiGatewayEmulatorMode apiGate
273275
""Path"": ""/{config.RouteName}""
274276
}}");
275277

276-
cancellationTokenSource.CancelAfter(5000);
277-
var settings = new RunCommandSettings { NoLaunchWindow = true, ApiGatewayEmulatorMode = apiGatewayMode, ApiGatewayEmulatorPort = apiGatewayPort};
278+
cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(60));
279+
var settings = new RunCommandSettings { NoLaunchWindow = true, ApiGatewayEmulatorMode = apiGatewayMode, ApiGatewayEmulatorPort = apiGatewayPort, LambdaEmulatorPort = lambdaPort};
278280

279281
var command = new RunCommand(_mockInteractiveService.Object, _mockEnvironmentManager.Object);
280282
var context = new CommandContext(new List<string>(), _mockRemainingArgs.Object, "run", null);

0 commit comments

Comments
 (0)