| 1837 | } |
| 1838 | |
| 1839 | func MustWaitForAnyProvisioner(t *testing.T, db database.Store) { |
| 1840 | t.Helper() |
| 1841 | ctx := ctxWithProvisionerPermissions(testutil.Context(t, testutil.WaitShort)) |
| 1842 | // testutil.Eventually(t, func) |
| 1843 | testutil.Eventually(ctx, t, func(ctx context.Context) (done bool) { |
| 1844 | daemons, err := db.GetProvisionerDaemons(ctx) |
| 1845 | return err == nil && len(daemons) > 0 |
| 1846 | }, testutil.IntervalFast, "no provisioner daemons found") |
| 1847 | } |
| 1848 | |
| 1849 | // MustWaitForProvisionersUnavailable waits for provisioners to become unavailable for a specific workspace |
| 1850 | func MustWaitForProvisionersUnavailable(t *testing.T, db database.Store, workspace codersdk.Workspace, tags map[string]string, checkTime time.Time) { |