Files
tasks/common/testing/long.go
David ReissandStephan Behnke 15b1164087 Matching fairness: standing backlog test (#8028)
## What changed?
Add unit test for backlog manager that sends tasks through with standing
backlogs.

## Why?
Small framework to test concurrent operations on backlog managers.

## How did you test it?
- [x] added new unit test(s)

---------

Co-authored-by: Stephan Behnke <[email protected]>
2025-07-22 16:47:54 +01:00

24 lines
534 B
Go

package testing
import (
"os"
"strconv"
"testing"
)
// LongTest calls Skip() on the testing.T or suite unless the environment variable
// TEMPORAL_TEST_LONG is set to true.
func LongTest(t any) {
if long, _ := strconv.ParseBool(os.Getenv("TEMPORAL_TEST_LONG")); long {
return
}
if s, ok := t.(interface{ T() *testing.T }); ok {
t = s.T()
}
if s, ok := t.(interface{ Skip(...any) }); ok {
s.Skip("skipping long test, use TEMPORAL_TEST_LONG=1 to run")
}
panic("skipping long test, use TEMPORAL_TEST_LONG=1 to run")
}