Fix flaky TestLifecycleSCEPExpiration test. (#23534)
#20936 # Checklist for submitter - [x] Added/updated tests
This commit is contained in:
@@ -590,8 +590,13 @@ func (s *integrationMDMTestSuite) setupLifecycleSettings() {
|
||||
// Host is renewing SCEP certificates
|
||||
func (s *integrationMDMTestSuite) TestLifecycleSCEPCertExpiration() {
|
||||
t := s.T()
|
||||
t.Skip("flaky test, see https://github.com/fleetdm/fleet/issues/20936")
|
||||
ctx := context.Background()
|
||||
|
||||
// Skip worker jobs to avoid running into timing issues with this test.
|
||||
// We can manually run the jobs if needed with s.runWorker().
|
||||
s.skipWorkerJobs = true
|
||||
t.Cleanup(func() { s.skipWorkerJobs = false })
|
||||
|
||||
// ensure there's a token for automatic enrollments
|
||||
s.enableABM(t.Name())
|
||||
s.runDEPSchedule()
|
||||
|
||||
@@ -97,14 +97,16 @@ type integrationMDMTestSuite struct {
|
||||
onIntegrationsScheduleDone func() // function called when integrationsSchedule.Trigger() job completed
|
||||
mdmStorage *mysql.NanoMDMStorage
|
||||
worker *worker.Worker
|
||||
mdmCommander *apple_mdm.MDMAppleCommander
|
||||
logger kitlog.Logger
|
||||
scepChallenge string
|
||||
appleVPPConfigSrv *httptest.Server
|
||||
appleVPPConfigSrvConfig *appleVPPConfigSrvConf
|
||||
appleITunesSrv *httptest.Server
|
||||
appleGDMFSrv *httptest.Server
|
||||
mockedDownloadFleetdmMeta fleetdbase.Metadata
|
||||
// Flag to skip jobs processing by worker
|
||||
skipWorkerJobs bool
|
||||
mdmCommander *apple_mdm.MDMAppleCommander
|
||||
logger kitlog.Logger
|
||||
scepChallenge string
|
||||
appleVPPConfigSrv *httptest.Server
|
||||
appleVPPConfigSrvConfig *appleVPPConfigSrvConf
|
||||
appleITunesSrv *httptest.Server
|
||||
appleGDMFSrv *httptest.Server
|
||||
mockedDownloadFleetdmMeta fleetdbase.Metadata
|
||||
}
|
||||
|
||||
// appleVPPConfigSrvConf is used to configure the mock server that mocks Apple's VPP endpoints.
|
||||
@@ -261,6 +263,9 @@ func (s *integrationMDMTestSuite) SetupSuite() {
|
||||
ctx, name, s.T().Name(), 1*time.Minute, ds, ds,
|
||||
schedule.WithLogger(logger),
|
||||
schedule.WithJob("integrations_worker", func(ctx context.Context) error {
|
||||
if s.skipWorkerJobs {
|
||||
return nil
|
||||
}
|
||||
return s.worker.ProcessJobs(ctx)
|
||||
}),
|
||||
schedule.WithJob("dep_cooldowns", func(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user