@@ -127,24 +127,20 @@ func TestStartDatadogAgentExperiment_DDANotFound(t *testing.T) {
127127 assert .Error (t , d .startDatadogAgentExperiment (context .Background (), testStartRequest ()))
128128}
129129
130- func TestStartDatadogAgentExperiment_Running (t * testing.T ) {
131- d , _ := testDaemon (testDDAObject (v2alpha1 .ExperimentPhaseRunning ), testInstallerConfigWithDDA ())
132- assert .Error (t , d .startDatadogAgentExperiment (context .Background (), testStartRequest ()))
133- }
134-
135- func TestStartDatadogAgentExperiment_Running_SameID_Idempotent (t * testing.T ) {
130+ func TestStartDatadogAgentExperiment_Running_Idempotent (t * testing.T ) {
136131 dda := testDDAObject (v2alpha1 .ExperimentPhaseRunning )
137- req := testStartRequest ()
138- dda .Status .Experiment .ID = req .ID // same ID as the incoming request
139132 d , c := testDaemon (dda , testInstallerConfigWithDDA ())
133+ // Backend retries with a new task UUID; should be treated as idempotent.
134+ req := testStartRequest ()
135+ req .ID = "retry-task-uuid"
140136 require .NoError (t , d .startDatadogAgentExperiment (context .Background (), req ))
141137
142138 // DDA should be unchanged — no re-patch, no status update.
143139 got := & v2alpha1.DatadogAgent {}
144140 require .NoError (t , c .Get (context .Background (), testDDANSN , got ))
145141 require .NotNil (t , got .Status .Experiment )
146142 assert .Equal (t , v2alpha1 .ExperimentPhaseRunning , got .Status .Experiment .Phase )
147- assert .Equal (t , req . ID , got .Status .Experiment .ID )
143+ assert .Equal (t , "old-exp" , got .Status .Experiment .ID )
148144}
149145
150146func TestStartDatadogAgentExperiment_Stopped (t * testing.T ) {
0 commit comments