Flaky test fix: Skip worker jobs to avoid race conditions in tests (#40536)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40535

Fixes a flaky test (and possibly others) by turning off worker jobs
while the test is running. @gillespi314 did a similar fix recently in
https://github.com/fleetdm/fleet/pull/39106; this adds it to other
vulnerable tests including
`TestSetupExperienceFlowWithRequiredSoftwareVPP` which I recently got a
failure on in CI.
This commit is contained in:
Scott Gress
2026-02-25 15:20:40 -06:00
committed by GitHub
parent 0693041f13
commit b0a0c0cb6f
@@ -583,6 +583,8 @@ func (s *integrationMDMTestSuite) TestSetupExperienceFlowWithSoftwareAndScriptFo
t := s.T()
ctx := context.Background()
s.setSkipWorkerJobs(t)
teamDevice, enrolledHost, _ := s.createTeamDeviceForSetupExperienceWithProfileSoftwareAndScript()
// enroll the host
@@ -739,6 +741,8 @@ func (s *integrationMDMTestSuite) TestSetupExperienceVPPInstallError() {
t := s.T()
ctx := context.Background()
s.setSkipWorkerJobs(t)
teamDevice, enrolledHost, team := s.createTeamDeviceForSetupExperienceWithProfileSoftwareAndScript()
orgName := "Fleet Device Management Inc."
@@ -1190,6 +1194,8 @@ func (s *integrationMDMTestSuite) TestSetupExperienceFlowCancelScript() {
t := s.T()
ctx := context.Background()
s.setSkipWorkerJobs(t)
device, host, _ := s.createTeamDeviceForSetupExperienceWithProfileSoftwareAndScript()
// enroll the host
@@ -3000,6 +3006,8 @@ func (s *integrationMDMTestSuite) TestSetupExperienceFlowWithRequiredSoftwareVPP
t := s.T()
ctx := context.Background()
s.setSkipWorkerJobs(t)
teamDevice, enrolledHost, team := s.createTeamDeviceForSetupExperienceWithProfileSoftwareAndScript()
payload := map[string]any{