(t *testing.T, ctx context.Context)
| 247 | } |
| 248 | |
| 249 | func (d *Daprd) WaitUntilRunning(t *testing.T, ctx context.Context) { |
| 250 | t.Helper() |
| 251 | |
| 252 | client := client.HTTP(t) |
| 253 | require.EventuallyWithT(t, func(c *assert.CollectT) { |
| 254 | cctx, cancel := context.WithTimeout(ctx, time.Second) |
| 255 | defer cancel() |
| 256 | req, err := http.NewRequestWithContext(cctx, http.MethodGet, fmt.Sprintf("http://%s/v1.0/healthz", d.HTTPAddress()), nil) |
| 257 | require.NoError(t, err) |
| 258 | resp, err := client.Do(req) |
| 259 | if assert.NoError(c, err) { |
| 260 | defer resp.Body.Close() |
| 261 | assert.Equal(c, http.StatusNoContent, resp.StatusCode) |
| 262 | } |
| 263 | }, 30*time.Second, 10*time.Millisecond) |
| 264 | } |
| 265 | |
| 266 | func (d *Daprd) WaitUntilAppHealth(t *testing.T, ctx context.Context) { |
| 267 | switch d.appProtocol { |
no test coverage detected