adobe / adobe/aem-testing-clients

SecurityClient.createUser fail randomly

Open
#29 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
57
Forks
39
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

Open the contributing guide

Research direction

Trace SecurityClient.createUser in SecurityClient.java through User.createUser and AbstractAuthorizable.getAuthorizableNodeWithRetry. Reproduce the intermittent failure, then inspect how the created-user response and retry polling determine the authorizable path; done means createUser reliably returns the created user without the not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.