I was able to accomplish this via the flag library in my testing function: flag.Set("test.timeout", "30m0s")
I found that being read from here: https://github.com/golang/go/blob/d21953df047868ed3bcfd0172a6c1672642f5b4a/src/cmd/go/testdata/script/test_timeout.txt#L22 So then I just changed the Lookup() function to the Set() function. Here's my working example when using go test to execute some terragrunt / terraform tests: func TestBasicRun(t *testing.T) { flag.Set("test.timeout", "30m0s") fmt.Println("timeout: " + flag.Lookup("test.timeout").Value.String()) terraformOptions := &terraform.Options{ TerraformBinary: "terragrunt", TerraformDir: "./basic-run", Lock: true, } defer terraform.Destroy(t, terraformOptions) terraform.InitAndApplyAndIdempotent(t, terraformOptions) } I think you can disable it by setting it to something like: "0m0s" On Monday, January 20, 2020 at 7:03:36 PM UTC-6 Jason E. Aten wrote: > I have a long running test where I would like to set the testing package > timeout to 30 minutes from with the my_test.go code. > > This would prevent me from forgetting to add the timeout flag, and then > discovering 10 minutes later that it was needed. > > Is this possible? Or just a way to disable the timeouts all together from > Go _test.go code. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5a36865f-436b-4fab-8d44-64795e77a5bcn%40googlegroups.com.