(t *testing.T, ctx context.Context)
| 43 | } |
| 44 | |
| 45 | func (a *allfail) Run(t *testing.T, ctx context.Context) { |
| 46 | a.scheduler.WaitUntilRunning(t, ctx) |
| 47 | |
| 48 | client := a.scheduler.Client(t, ctx) |
| 49 | |
| 50 | _, err := client.ScheduleJob(ctx, a.scheduler.JobNowJob("test", "namespace", "appid1")) |
| 51 | require.NoError(t, err) |
| 52 | |
| 53 | triggered := a.scheduler.WatchJobsFailed(t, ctx, &schedulerv1.WatchJobsRequestInitial{ |
| 54 | AppId: "appid1", Namespace: "namespace", |
| 55 | }) |
| 56 | |
| 57 | for range 4 { |
| 58 | select { |
| 59 | case name := <-triggered: |
| 60 | assert.Equal(t, "test", name) |
| 61 | case <-time.After(time.Second * 2): |
| 62 | require.Fail(t, "timed out waiting for job") |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | select { |
| 67 | case <-triggered: |
| 68 | assert.Fail(t, "unexpected trigger") |
| 69 | case <-time.After(time.Second * 2): |
| 70 | } |
| 71 | } |
nothing calls this directly
no test coverage detected