UpdateProvisionerLastSeenAt updates the provisioner daemon's LastSeenAt timestamp to the specified time to prevent it from appearing stale during autobuild operations
(t *testing.T, db database.Store, id uuid.UUID, tickTime time.Time)
| 1825 | // UpdateProvisionerLastSeenAt updates the provisioner daemon's LastSeenAt timestamp |
| 1826 | // to the specified time to prevent it from appearing stale during autobuild operations |
| 1827 | func UpdateProvisionerLastSeenAt(t *testing.T, db database.Store, id uuid.UUID, tickTime time.Time) { |
| 1828 | t.Helper() |
| 1829 | ctx := ctxWithProvisionerPermissions(context.Background()) |
| 1830 | t.Logf("Updating provisioner %s LastSeenAt to %v", id, tickTime) |
| 1831 | err := db.UpdateProvisionerDaemonLastSeenAt(ctx, database.UpdateProvisionerDaemonLastSeenAtParams{ |
| 1832 | ID: id, |
| 1833 | LastSeenAt: sql.NullTime{Time: tickTime, Valid: true}, |
| 1834 | }) |
| 1835 | require.NoError(t, err) |
| 1836 | t.Logf("Successfully updated provisioner LastSeenAt") |
| 1837 | } |
| 1838 | |
| 1839 | func MustWaitForAnyProvisioner(t *testing.T, db database.Store) { |
| 1840 | t.Helper() |