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

SecurityClient.createUser fail randomly #29

Open
tyge68 opened this issue Feb 29, 2020 · 2 comments
Open

SecurityClient.createUser fail randomly #29

tyge68 opened this issue Feb 29, 2020 · 2 comments

Comments

@tyge68
Copy link
Contributor

tyge68 commented Feb 29, 2020

We observe that from time to time the createUser fails randomly.

Mainly it fails to get the created user path in getAuthorizableNodeWithRetry as seen below in the stack trace.

While debugging, the user is created but the code logic that do this retry seems to be wrong or not waiting long enough (happening more often on cloud AEM).

[ForkJoinPool-1-worker-0] ERROR com.adobe.cq.sites.testing.utils.TestContentBuilder - Authorizable testCopyPageToSameFolderWithNewLabelAsAdmin_PWmMZrkw not found!
org.apache.sling.testing.clients.ClientException: Authorizable testCopyPageToSameFolderWithNewLabelAsAdmin_PWmMZrkw not found!
at com.adobe.cq.testing.client.security.AbstractAuthorizable.getAuthorizableNodeWithRetry(AbstractAuthorizable.java:270)
at com.adobe.cq.testing.client.security.AbstractAuthorizable.getAuthorizablePath(AbstractAuthorizable.java:225)
at com.adobe.cq.testing.client.security.AbstractAuthorizable.(AbstractAuthorizable.java:82)
at com.adobe.cq.testing.client.security.User.(User.java:56)
at com.adobe.cq.testing.client.security.User.createUser(User.java:217)
at com.adobe.cq.testing.client.SecurityClient.createUser(SecurityClient.java:169)

What seems wrong is that it need to poll to know the created user path, shouldn't the endpoint used to create the user returning the path of the created user in the response ?

@volteanu
Copy link
Member

volteanu commented Mar 4, 2020

@tyge68 are you sure the user is created? it might be a sync problem at create, thus causing the getAuthorizableNodeWithRetry to fail.

@tyge68
Copy link
Contributor Author

tyge68 commented Mar 4, 2020

Yes I debugged once this case, the user is created, the endpoint that is used to create the user wouldn't return 200 anyway otherwise, also it would make sense to log or assert that the returned response from the create operation contains the user path.

It can be that the search indexing is slower from time to time, so polling for a longer time may solve it (for example it could be configurable).

tyge68 added a commit to tyge68/aem-testing-clients that referenced this issue Mar 16, 2020
tyge68 added a commit to tyge68/aem-testing-clients that referenced this issue Mar 17, 2020
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

No branches or pull requests

2 participants