(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func TestWorker_SkipsFreshRows(t *testing.T) { |
| 152 | t.Parallel() |
| 153 | ctx := testutil.Context(t, testutil.WaitShort) |
| 154 | |
| 155 | tickDone := make(chan struct{}) |
| 156 | |
| 157 | ctrl := gomock.NewController(t) |
| 158 | store := dbmock.NewMockStore(ctrl) |
| 159 | |
| 160 | store.EXPECT().AcquireStaleChatDiffStatuses(gomock.Any(), gomock.Any()). |
| 161 | DoAndReturn(func(context.Context, int32) ([]database.AcquireStaleChatDiffStatusesRow, error) { |
| 162 | // No stale rows — tick returns immediately. |
| 163 | close(tickDone) |
| 164 | return nil, nil |
| 165 | }) |
| 166 | |
| 167 | mClock := quartz.NewMock(t) |
| 168 | logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) |
| 169 | refresher := newTestRefresher(t, mClock) |
| 170 | worker := gitsync.NewWorker(store, refresher, nil, mClock, logger) |
| 171 | |
| 172 | tickOnce(ctx, t, mClock, worker, tickDone) |
| 173 | } |
| 174 | |
| 175 | func TestWorker_LimitsToNRows(t *testing.T) { |
| 176 | t.Parallel() |
nothing calls this directly
no test coverage detected