Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testenv readiness checks #1687

Open
2 tasks done
ramizpolic opened this issue May 21, 2024 · 0 comments
Open
2 tasks done

Fix testenv readiness checks #1687

ramizpolic opened this issue May 21, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers test:e2e test

Comments

@ramizpolic
Copy link
Member

Description

The readiness check for services can report ready behaviour even when all the services are not ready.

Expected Behavior

Ready returns true iff all services are ready.

Actual Behavior

Ready can be true when last service is ready, unrelated to the state of the previous service.

Steps to Reproduce

func (e *KubernetesEnv) ServicesReady(ctx context.Context) (bool, error) {
logger := utils.GetLoggerFromContextOrDiscard(ctx).WithFields(e.meta)
services, err := e.Services(ctx)
if err != nil {
return false, fmt.Errorf("failed to retrieve list of services: %w", err)
}
var result bool
for _, service := range services {
logger.Debugf("checking service readiness. Service=%s State=%s", service.GetID(), service.GetState())
switch service.GetState() {
case envtypes.ServiceStateReady, envtypes.ServiceStateDegraded:
result = true
case envtypes.ServiceStateNotReady, envtypes.ServiceStateUnknown:
fallthrough
default:
result = false
}
}
return result, nil
}

Checklist

@ramizpolic ramizpolic added bug Something isn't working test test:e2e labels May 21, 2024
@paralta paralta added the good first issue Good for newcomers label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers test:e2e test
Projects
None yet
Development

No branches or pull requests

2 participants