(t *testing.T)
| 875 | } |
| 876 | |
| 877 | func TestRunCheckerTraceNotReady(t *testing.T) { |
| 878 | seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC) |
| 879 | |
| 880 | config := vultureConfiguration{ |
| 881 | tempoOrgID: "orgID", |
| 882 | tempoWriteBackoffDuration: 10 * time.Hour, // Very long to ensure trace not ready |
| 883 | tempoLongWriteBackoffDuration: 20 * time.Hour, |
| 884 | } |
| 885 | |
| 886 | logger = zap.NewNop() |
| 887 | |
| 888 | ticker := time.NewTicker(time.Millisecond) // fires immediately |
| 889 | |
| 890 | // Checker function that signals completion |
| 891 | var checkerCalled bool |
| 892 | checker := func(_ *util.TraceInfo, _ *zap.Logger) { |
| 893 | checkerCalled = true |
| 894 | } |
| 895 | |
| 896 | selectPastTimestamp := func(_ time.Time) (newStart, ts time.Time, skip bool) { |
| 897 | return seed, seed, false |
| 898 | } |
| 899 | runChecker(ticker, config, selectPastTimestamp, checker, logger) |
| 900 | time.Sleep(5 * time.Millisecond) |
| 901 | // Ensure the checker was not called because trace is not ready |
| 902 | assert.False(t, checkerCalled) |
| 903 | } |
| 904 | |
| 905 | func TestRunCheckerSuccess(t *testing.T) { |
| 906 | seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC) |
nothing calls this directly
no test coverage detected