MCPcopy
hub / github.com/dapr/dapr / Run

Method Run

tests/integration/suite/scheduler/failurepolicy/drop/failed.go:46–77  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

44}
45
46func (f *failed) Run(t *testing.T, ctx context.Context) {
47 f.scheduler.WaitUntilRunning(t, ctx)
48
49 client := f.scheduler.Client(t, ctx)
50
51 job := f.scheduler.JobNowJob("test", "namespace", "appid1")
52 job.Job.FailurePolicy = &corev1.JobFailurePolicy{
53 Policy: &corev1.JobFailurePolicy_Drop{
54 Drop: new(corev1.JobFailurePolicyDrop),
55 },
56 }
57
58 _, err := client.ScheduleJob(ctx, job)
59 require.NoError(t, err)
60
61 triggered := f.scheduler.WatchJobsFailed(t, ctx, &schedulerv1.WatchJobsRequestInitial{
62 AppId: "appid1", Namespace: "namespace",
63 })
64
65 select {
66 case name := <-triggered:
67 assert.Equal(t, "test", name)
68 case <-time.After(time.Second * 5):
69 require.Fail(t, "timed out waiting for job")
70 }
71
72 select {
73 case <-triggered:
74 assert.Fail(t, "unexpected trigger")
75 case <-time.After(time.Second * 2):
76 }
77}

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
JobNowJobMethod · 0.80
WatchJobsFailedMethod · 0.80
ClientMethod · 0.65
ScheduleJobMethod · 0.65
WaitUntilRunningMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected