fleet/server/worker
Magnus Jensen 57566301e1
Wait for expected profiles to be sent before releasing device (#31381)
This PR addresses the concern of potentially being able to release a
device before any profile is sent, and the check thinking there is no
pending. It addresses both the release worker, but also the orbit setup
experience endpoint, even though that is less likely.

_Checked the query against my host on dogfood where it took 0.1 seconds,
with the single host._

fixes: #31143 

_I also ended up putting my main test in a new file
`integration_mdm_release_worker_test.go` and decided not to do fancy
setup, as there is only one test so no recurring things, and based on
our retro talk also moved the setup experience related tests inside of
`integration_mdm_dep_test.go` into their separate file
`integration_mdm_setup_experience_test.go`_

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests

- [ ] QA'd all new/changed functionality manually (No, since this one is
hard to reproduce, but instead wrote an integration test before doing
the change to verify the behaviour.)
2025-07-31 17:50:57 +02:00
..
apple_mdm.go Wait for expected profiles to be sent before releasing device (#31381) 2025-07-31 17:50:57 +02:00
apple_mdm_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
automation_failer.go Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
automation_failer_test.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
db_migrations.go MABM bugfix: fix the expected format of the migrated VPP token (#21761) 2024-09-03 13:23:44 -04:00
db_migrations_test.go MABM bugfix: fix the expected format of the migrated VPP token (#21761) 2024-09-03 13:23:44 -04:00
jira.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
jira_test.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
macos_setup_assistant.go Remove pending MDM device from Fleet (#23067) 2024-10-24 16:42:30 -05:00
macos_setup_assistant_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
vpp_verification.go fix issues in setup experience due to VPP verification (#30679) 2025-07-11 14:57:15 -04:00
worker.go Speedup worker-based device release on ADE enrollment setup (#29892) 2025-06-16 13:14:25 -04:00
worker_test.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
zendesk.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
zendesk_test.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00