From b0a0c0cb6f85e43d84df5c9c02272e730a3fb294 Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Wed, 25 Feb 2026 15:20:40 -0600 Subject: [PATCH] Flaky test fix: Skip worker jobs to avoid race conditions in tests (#40536) **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. --- server/service/integration_mdm_setup_experience_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/service/integration_mdm_setup_experience_test.go b/server/service/integration_mdm_setup_experience_test.go index 052da14769..d84e79bfce 100644 --- a/server/service/integration_mdm_setup_experience_test.go +++ b/server/service/integration_mdm_setup_experience_test.go @@ -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{