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

Method Run

tests/integration/suite/scheduler/failurepolicy/noset/allfail.go:45–71  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

43}
44
45func (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}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected