Skip to content

Commit

Permalink
ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoffatt committed Nov 30, 2023
1 parent 6fee4e6 commit 525974e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lambda/sigterm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package lambda

import (
"io/ioutil" //nolint: staticcheck
"math/rand"
"net/http"
"os"
"os/exec"
Expand All @@ -32,6 +31,7 @@ func TestEnableSigterm(t *testing.T) {
handlerBuild.Stdout = os.Stderr
require.NoError(t, handlerBuild.Run())

portI := 0
for name, opts := range map[string]struct {
envVars []string
assertLogs func(t *testing.T, logs string)
Expand All @@ -51,8 +51,9 @@ func TestEnableSigterm(t *testing.T) {
},
} {
t.Run(name, func(t *testing.T) {
addr1 := "localhost:" + strconv.Itoa(8000+rand.Intn(999))
addr2 := "localhost:" + strconv.Itoa(9000+rand.Intn(999))
portI += 1
addr1 := "localhost:" + strconv.Itoa(8000+portI)
addr2 := "localhost:" + strconv.Itoa(9000+portI)
rieInvokeAPI := "http://" + addr1 + "/2015-03-31/functions/function/invocations"
// run the runtime interface emulator, capture the logs for assertion
cmd := exec.Command("aws-lambda-rie", "--runtime-interface-emulator-address", addr1, "--runtime-api-address", addr2, "sigterm.handler")
Expand Down
5 changes: 2 additions & 3 deletions lambdaurl/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"io"
"io/ioutil"
"log"
"math/rand"
"net/http"
"os"
"os/exec"
Expand Down Expand Up @@ -215,8 +214,8 @@ func TestRequestContext(t *testing.T) {
}

func TestStartViaEmulator(t *testing.T) {
addr1 := "localhost:" + strconv.Itoa(8000+rand.Intn(999))
addr2 := "localhost:" + strconv.Itoa(9000+rand.Intn(999))
addr1 := "localhost:" + strconv.Itoa(6001)
addr2 := "localhost:" + strconv.Itoa(7001)
rieInvokeAPI := "http://" + addr1 + "/2015-03-31/functions/function/invocations"
if _, err := exec.LookPath("aws-lambda-rie"); err != nil {
t.Skipf("%v - install from https://github.com/aws/aws-lambda-runtime-interface-emulator/", err)
Expand Down

0 comments on commit 525974e

Please sign in to comment.