Issue: Test timing out after AMI is created and not going to defer step.
func TestPackerBuild(t *testing.T) {
t.Parallel()
test_structure.RunTestStage(t, "build_ami", func() {
buildBaseAMI(t, awsRegion, workingDir, baseTemplate)
})
defer test_structure.RunTestStage(t, "cleanup_ami", func() {
deleteAMI(t, awsRegion, workingDir)
})
}
func buildBaseAMI(t *testing.T, awsRegion string, workingDir string, fileName string) {
packerOptions := &packer.Options{
Template: workingDir + fileName,
Env: map[string]string{
},
}
test_structure.SavePackerOptions(t, workingDir, packerOptions)
amiID := packer.BuildAmi(t, packerOptions)
test_structure.SaveAmiId(t, workingDir, amiID)
}
terratest_1 | panic: test timed out after 30m0s
terratest_1 |
terratest_1 | goroutine 22 [running]:
terratest_1 | testing.(*M).startAlarm.func1()
terratest_1 | /usr/local/go/src/testing/testing.go:1240 +0xfc
terratest_1 | created by time.goFunc
terratest_1 | /usr/local/go/src/time/sleep.go:172 +0x44
terratest_1 |
terratest_1 | goroutine 1 [chan receive]:
terratest_1 | testing.tRunner.func1(0xc4201e6000)
terratest_1 | /usr/local/go/src/testing/testing.go:753 +0x11d
terratest_1 | testing.tRunner(0xc4201e6000, 0xc4201e5df8)
terratest_1 | /usr/local/go/src/testing/testing.go:783 +0xf2
terratest_1 | testing.runTests(0xc4201195a0, 0xa2ea10, 0x1, 0x1, 0x411a99)
terratest_1 | /usr/local/go/src/testing/testing.go:1061 +0x2c4
terratest_1 | testing.(*M).Run(0xc420138080, 0x0)
terratest_1 | /usr/local/go/src/testing/testing.go:978 +0x171
terratest_1 | main.main()
terratest_1 | _testmain.go:42 +0x151
terratest_1 |
terratest_1 | goroutine 20 [IO wait]:
terratest_1 | internal/poll.runtime_pollWait(0x7fec55acaf00, 0x72, 0xc420057770)
terratest_1 | /usr/local/go/src/runtime/netpoll.go:173 +0x57
terratest_1 | internal/poll.(*pollDesc).wait(0xc4200986a8, 0x72, 0xffffffffffffff01, 0x88d9c0, 0xa01468)
terratest_1 | /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9b
terratest_1 | internal/poll.(*pollDesc).waitRead(0xc4200986a8, 0xc4201f6001, 0xf52, 0xf52)
terratest_1 | /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d
terratest_1 | internal/poll.(*FD).Read(0xc420098690, 0xc4201f60ae, 0xf52, 0xf52, 0x0, 0x0, 0x0)
terratest_1 | /usr/local/go/src/internal/poll/fd_unix.go:157 +0x17d
terratest_1 | os.(*File).read(0xc420096158, 0xc4201f60ae, 0xf52, 0xf52, 0x0, 0x88, 0xc42008a0c0)
terratest_1 | /usr/local/go/src/os/file_unix.go:226 +0x4e
terratest_1 | os.(*File).Read(0xc420096158, 0xc4201f60ae, 0xf52, 0xf52, 0x0, 0x2, 0x2)
terratest_1 | /usr/local/go/src/os/file.go:107 +0x6a
terratest_1 | bufio.(*Scanner).Scan(0xc420057ad8, 0xc420057a48)
terratest_1 | /usr/local/go/src/bufio/scan.go:208 +0xbf
terratest_1 | infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/shell.readStdoutAndStderr(0xc4201e60f0, 0x88f820, 0xc420096158, 0x88f820, 0xc420096168, 0x0,
0x0, 0xc4201c0270, 0xc420192300)
terratest_1 | /go/src/infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/shell/command.go:94 +0x15e
terratest_1 | infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/shell.RunCommandAndGetOutputE(0xc4201e60f0, 0x80a0d3, 0x6, 0xc42009aec0, 0x3, 0x4, 0x0, 0x0,
0xc4201c0270, 0xc420057c98, ...)
terratest_1 | /go/src/infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/shell/command.go:74 +0x2b6
terratest_1 | infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/packer.BuildAmiE(0xc4201e60f0, 0xc4201c0240, 0x33, 0xc420057d40, 0x73983d, 0xc4201e60f0)
terratest_1 | /go/src/infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/packer/packer.go:41 +0x15e
terratest_1 | infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/packer.BuildAmi(0xc4201e60f0, 0xc4201c0240, 0x16, 0xc4201c0240)
terratest_1 | /go/src/infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/packer/packer.go:24 +0x39
terratest_1 | infrastructure/tests/packer.buildBaseAMI(0xc4201e60f0, 0x80b184, 0x9, 0x81090c, 0x16, 0x8120d5, 0x19)
terratest_1 | /go/src/infrastructure/tests/packer/wm-base_test.go:67 +0x6a3
terratest_1 | infrastructure/tests/packer.TestPackerBuild.func1()
terratest_1 | /go/src/infrastructure/tests/packer/wm-base_test.go:26 +0x60
terratest_1 | infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/test-structure.RunTestStage(0xc4201e60f0, 0x80ae48, 0x9, 0xc420057f58)
terratest_1 | /go/src/infrastructure/tests/vendor/github.com/gruntwork-io/terratest/modules/test-structure/test_structure.go:24 +0x20a
terratest_1 | infrastructure/tests/packer.TestPackerBuild(0xc4201e60f0)
terratest_1 | /go/src/infrastructure/tests/packer/wm-base_test.go:25 +0x115
terratest_1 | testing.tRunner(0xc4201e60f0, 0x8232e0)
terratest_1 | /usr/local/go/src/testing/testing.go:777 +0xd0
terratest_1 | created by testing.(*T).Run
terratest_1 | /usr/local/go/src/testing/testing.go:824 +0x2e0
terratest_1 |
terratest_1 | goroutine 21 [chan receive]:
terratest_1 | testing.runTests.func1.1(0xc4201e6000)
terratest_1 | /usr/local/go/src/testing/testing.go:1068 +0x3b
terratest_1 | created by testing.runTests.func1
terratest_1 | /usr/local/go/src/testing/testing.go:1068 +0xa2
terratest_1 | FAIL infrastructure/tests/packer 1800.013s
tests_terratest_1 exited with code 1
~/go/src/wm/infrastructure/tests TEC