Skip to content

fix tests - adding missing role, increase timeout #1655

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

Merged
merged 4 commits into from
Jan 10, 2025
Merged

fix tests - adding missing role, increase timeout #1655

merged 4 commits into from
Jan 10, 2025

Conversation

nammn
Copy link
Collaborator

@nammn nammn commented Jan 9, 2025

Summary:

from test

    	            	extra elements in list A:
    	            	([]interface {}) (len=1) {
    	            	 (automationconfig.CustomRole) {
    	            	  Role: (string) (len=30) "MongodbAutomationAgentUserRole",
    	            	  DB: (string) (len=5) "admin",
    	            	  Privileges: ([]automationconfig.Privilege) (len=1) {
    	            	   (automationconfig.Privilege) {
    	            	    Resource: (automationconfig.Resource) {
    	            	     DB: (*string)(<nil>),
    	            	     Collection: (*string)(<nil>),
    	            	     AnyResource: (bool) true,
    	            	     Cluster: (bool) false
    	            	    },
    	            	    Actions: ([]string) (len=1) {
    	            	     (string) (len=22) "bypassDefaultMaxTimeMS"
    	            	    }
    	            	   }
    	            	  },
    	            	  Roles: ([]automationconfig.Role) {
    	            	  },
    	            	  AuthenticationRestrictions: ([]automationconfig.AuthenticationRestriction) <nil>
    	            	 }
    	            	}

https://github.com/mongodb/mongodb-kubernetes-operator/actions/runs/12671524133/job/35384225989#step:13:314

its passing now: https://github.com/mongodb/mongodb-kubernetes-operator/actions/runs/12707699284/job/35423341022?pr=1655

@@ -237,7 +237,7 @@ func DeployOperator(ctx context.Context, config TestConfig, resourceName string,
return err
}

if err := wait.PollUntilContextTimeout(ctx, time.Second, 60*time.Second, true, hasDeploymentRequiredReplicas(&dep)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, time.Second*2, 120*time.Second, true, hasDeploymentRequiredReplicas(&dep)); err != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the recent test failures, it was due to the fact that the deployment needed a bit more than 60 seconds to stablize

2m2s        Normal    Created                   pod/mongodb-kubernetes-operator-6c5f7d74b9-6qb6m    spec.containers{mongodb-kubernetes-operator}   kubelet, kind-control-plane      Created container mongodb-kubernetes-operator                                                                                       2m2s         1       mongodb-kubernetes-operator-6c5f7d74b9-6qb6m.18194a55944214a5
61s         Warning   FailedScheduling          pod/mongodb-kubernetes-operator-57d64f66d7-9dmm5                                                   default-scheduler                0/1 nodes are available: 1 node(s) didn't match pod affinity/anti-affinity rules, 1 node(s) didn't match pod anti-affinity rules.   2m2s         3       mongodb-kubernetes-operator-57d64f66d7-9dmm5.18194a559645561a
45s         Normal    Killing                   pod/mongodb-kubernetes-operator-6c5f7d74b9-6qb6m    spec.containers{mongodb-kubernetes-operator}   kubelet, kind-control-plane      Stopping container mongodb-kubernetes-operator                                                                                      45s          1       mongodb-kubernetes-operator-6c5f7d74b9-6qb6m.18194a6763ffc4de
14s         Normal    Scheduled                 pod/mongodb-kubernetes-operator-57d64f66d7-9dmm5                                                   default-scheduler                Successfully assigned default/mongodb-kubernetes-operator-57d64f66d7-9dmm5 to kind-control-plane                                    14s          1       mongodb-kubernetes-operator-57d64f66d7-9dmm5.18194a6eb254d17d
13s         Normal    Started 

@nammn nammn changed the title fix test by only testing for contains fix tests - adding missing role, increase timeout Jan 10, 2025
@nammn nammn marked this pull request as ready for review January 10, 2025 10:52
Comment on lines +74 to 87
{
Role: "MongodbAutomationAgentUserRole",
DB: "admin",
Privileges: []mdbv1.Privilege{
{
Resource: mdbv1.Resource{
AnyResource: true,
},
Actions: []string{"bypassDefaultMaxTimeMS"},
},
},
Roles: []mdbv1.Role{},
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but we added this because the automation config sometimes had this role without us specifying it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - I think this test consistently fails IIUC. It seems the last time the ci was fully green was 4 months ago: https://github.com/mongodb/mongodb-kubernetes-operator/actions/workflows/e2e.yml?query=is%3Asuccess.

It would be nice to see single test history ...

Alternatively, we can cut that agent out from the received list.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, thanks. Feel free to resolve

Copy link
Collaborator

@lucian-tosa lucian-tosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nammn nammn merged commit 6acec25 into master Jan 10, 2025
51 of 53 checks passed
@nammn nammn deleted the fix-test branch January 10, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants