Skip to content

Commit

Permalink
e2e: Update logs for drpc related funcs
Browse files Browse the repository at this point in the history
Add debug logs in waitDRPCReady, waitDRPCDeleted, waitDRPCProgression,
waitDRPCPhase and waitAndUpdateDRPC

Signed-off-by: Parikshith <[email protected]>
  • Loading branch information
parikshithb committed Feb 7, 2025
1 parent 70fa6b9 commit 4c3a439
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion e2e/dractions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func waitAndUpdateDRPC(
return err
}

log.Info("Updating drpc " + strings.ToLower(string(action)) + " to " + targetCluster)
log.Debugf("Updating drpc " + strings.ToLower(string(action)) + " to " + targetCluster)

return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
drpc, err := getDRPC(client, namespace, drpcName)
Expand Down
18 changes: 12 additions & 6 deletions e2e/dractions/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func waitDRPCReady(ctx types.Context, client client.Client, namespace string, dr
log := ctx.Logger()
startTime := time.Now()

log.Info("Waiting until drpc is ready")
log.Debugf("Waiting for drpc %q in namespace %q to become ready", drpcName, namespace)

for {
drpc, err := getDRPC(client, namespace, drpcName)
Expand All @@ -62,7 +62,7 @@ func waitDRPCReady(ctx types.Context, client client.Client, namespace string, dr
peerReady := conditionMet(drpc.Status.Conditions, ramen.ConditionPeerReady)

if available && peerReady && drpc.Status.LastGroupSyncTime != nil {
log.Info("drpc is ready")
log.Debugf("drpc %q is ready", drpcName)

return nil
}
Expand All @@ -86,6 +86,8 @@ func waitDRPCPhase(ctx types.Context, client client.Client, namespace, name stri
log := ctx.Logger()
startTime := time.Now()

log.Debugf("Waiting for drpc %q in namespace %q to reach phase %q", name, namespace, phase)

for {
drpc, err := getDRPC(client, namespace, name)
if err != nil {
Expand All @@ -94,7 +96,7 @@ func waitDRPCPhase(ctx types.Context, client client.Client, namespace, name stri

currentPhase := drpc.Status.Phase
if currentPhase == phase {
log.Infof("drpc phase is %q", phase)
log.Debugf("drpc %q phase is %q", name, phase)

return nil
}
Expand Down Expand Up @@ -145,16 +147,18 @@ func waitDRPCDeleted(ctx types.Context, client client.Client, namespace string,
log := ctx.Logger()
startTime := time.Now()

log.Debugf("Waiting for drpc %q to be deleted in namespace %q", name, namespace)

for {
_, err := getDRPC(client, namespace, name)
if err != nil {
if errors.IsNotFound(err) {
log.Info("drpc is deleted")
log.Debugf("drpc %q is deleted", name)

return nil
}

log.Infof("Failed to get drpc: %s", err)
log.Debugf("drpc %q is deleted", name)
}

if time.Since(startTime) > util.Timeout {
Expand All @@ -175,6 +179,8 @@ func waitDRPCProgression(
log := ctx.Logger()
startTime := time.Now()

log.Debugf("Waiting for drpc %q in namespace %q to reach progression %q", name, namespace, progression)

for {
drpc, err := getDRPC(client, namespace, name)
if err != nil {
Expand All @@ -183,7 +189,7 @@ func waitDRPCProgression(

currentProgression := drpc.Status.Progression
if currentProgression == progression {
log.Infof("drpc progression is %q", progression)
log.Debugf("drpc %q progression is %q", name, progression)

return nil
}
Expand Down

0 comments on commit 4c3a439

Please sign in to comment.