{"record":{"id":"0ec07e9871018494","repo":"temporalio/temporal","slug":"skipping-long-test-use-temporal-test-long-1-to-ru","errorCode":null,"errorMessage":"skipping long test, use TEMPORAL_TEST_LONG=1 to run","messagePattern":"skipping long test, use TEMPORAL_TEST_LONG=1 to run","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"common/testing/long.go","lineNumber":22,"sourceCode":"\t\"os\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n// LongTest calls Skip() on the testing.T or suite unless the environment variable\n// TEMPORAL_TEST_LONG is set to true.\nfunc LongTest(t any) {\n\tif long, _ := strconv.ParseBool(os.Getenv(\"TEMPORAL_TEST_LONG\")); long {\n\t\treturn\n\t}\n\n\tif s, ok := t.(interface{ T() *testing.T }); ok {\n\t\tt = s.T()\n\t}\n\tif s, ok := t.(interface{ Skip(...any) }); ok {\n\t\ts.Skip(\"skipping long test, use TEMPORAL_TEST_LONG=1 to run\")\n\t}\n\tpanic(\"skipping long test, use TEMPORAL_TEST_LONG=1 to run\")\n}\n","sourceCodeStart":4,"sourceCodeEnd":24,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/testing/long.go#L4-L24","documentation":"LongTest marks a test as 'long' and is skipped unless the TEMPORAL_TEST_LONG=1 environment variable is set. It first tries t.Skip on the passed handle; if the handle implements neither T() *testing.T nor Skip(...any), it panics as a last-resort signal that a long test was attempted without the env var.","triggerScenarios":"Running a test that calls testing/long.LongTest(testHandle) without TEMPORAL_TEST_LONG=1 set, using a handle that lacks Skip (and lacks T()); the panic path fires when the wrapper interface is unsatisfied.","commonSituations":"Running `go test` locally on long integration tests; CI runs that omit TEMPORAL_TEST_LONG; passing a custom testing.TB implementation that doesn't implement Skip.","solutions":["Set TEMPORAL_TEST_LONG=1 in the environment to run long tests instead of skipping.","Omit long tests in normal runs (the intended default) and only enable the env var in dedicated long-test CI jobs.","Pass a *testing.T (or a handle implementing Skip) to LongTest so it skips cleanly instead of panicking."],"exampleFix":"// before\nlongtest.LongTest(customTB)\n// after\nlongtest.LongTest(t) // t is *testing.T, supports Skip\n// or run with: TEMPORAL_TEST_LONG=1 go test ./...","handlingStrategy":"fallback","validationCode":"// shell\n[ \"${TEMPORAL_TEST_LONG:-0}\" = \"1\" ] && echo \"long tests enabled\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set TEMPORAL_TEST_LONG=1 only in dedicated long-test CI jobs.","Pass a real *testing.T to LongTest so skipping is graceful."],"tags":["testing","skip","environment-variable","long-tests"],"backgroundTag":"test-skipped-missing-env-var","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}