FatalStack helps to fatal the test and print out the stacks of all running goroutines.
(t *testing.T, s string)
| 53 | |
| 54 | // FatalStack helps to fatal the test and print out the stacks of all running goroutines. |
| 55 | func FatalStack(t *testing.T, s string) { |
| 56 | t.Helper() |
| 57 | stackTrace := make([]byte, 1024*1024) |
| 58 | n := runtime.Stack(stackTrace, true) |
| 59 | t.Errorf("---> Test failed: %s", s) |
| 60 | t.Error(string(stackTrace[:n])) |
| 61 | t.Fatal(s) |
| 62 | } |
| 63 | |
| 64 | // ConditionFunc returns true when a condition is met. |
| 65 | type ConditionFunc func() (bool, error) |