Skip to content

Commit

Permalink
Add check for setting HasProbeCompleted
Browse files Browse the repository at this point in the history
Signed-off-by: nagesh bansal <[email protected]>
  • Loading branch information
Nageshbansal committed Dec 16, 2023
1 parent 9ec39bd commit f5f6c99
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/probe/cmdprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ loop:
select {
case <-chaosDetails.ProbeContext.Ctx.Done():
log.Info("Chaos Execution completed. Stopping Probes")
for index := range chaosresult.ProbeDetails {
if chaosresult.ProbeDetails[index].Name == probe.Name {
chaosresult.ProbeDetails[index].HasProbeCompleted = true
}
}
break loop
default:
err := triggerInlineCmdProbe(probe, chaosresult)
Expand Down
5 changes: 5 additions & 0 deletions pkg/probe/k8sprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ loop:
select {
case <-chaosDetails.ProbeContext.Ctx.Done():
log.Info("Chaos Execution completed. Stopping Probes")
for index := range chaosresult.ProbeDetails {
if chaosresult.ProbeDetails[index].Name == probe.Name {
chaosresult.ProbeDetails[index].HasProbeCompleted = true
}
}
break loop

default:
Expand Down
2 changes: 1 addition & 1 deletion pkg/probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func getDescription(err error) string {
}

// CheckForErrorInContinuousProbe check for the error in the continuous probes
func checkForErrorInContinuousProbe(resultDetails *types.ResultDetails, probeName string, timeout int, delay int) error {
func checkForErrorInContinuousProbe(resultDetails *types.ResultDetails, probeName string, delay int, timeout int) error {

probe := getProbeByName(probeName, resultDetails.ProbeDetails)
timeoutSignal := time.After(time.Duration(timeout) * time.Second)
Expand Down
5 changes: 5 additions & 0 deletions pkg/probe/promProbe.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ loop:
select {
case <-chaosDetails.ProbeContext.Ctx.Done():
log.Info("Chaos Execution completed. Stopping Probes")
for index := range chaosresult.ProbeDetails {
if chaosresult.ProbeDetails[index].Name == probe.Name {
chaosresult.ProbeDetails[index].HasProbeCompleted = true
}
}
break loop
default:
err = triggerPromProbe(probe, chaosresult)
Expand Down

0 comments on commit f5f6c99

Please sign in to comment.