[test] generate unique user names (#36179)
This commit is contained in:
parent
05d52b222f
commit
a6ff9f7f66
|
@ -59,11 +59,9 @@ public class UserFunctionIT extends ESRestTestCase {
|
||||||
private void setUpUsers() throws IOException {
|
private void setUpUsers() throws IOException {
|
||||||
int usersCount = name.getMethodName().startsWith("testSingle") ? 1 : randomIntBetween(5, 15);
|
int usersCount = name.getMethodName().startsWith("testSingle") ? 1 : randomIntBetween(5, 15);
|
||||||
users = new ArrayList<String>(usersCount);
|
users = new ArrayList<String>(usersCount);
|
||||||
|
users.addAll(randomUnique(() -> randomAlphaOfLengthBetween(1, 15), usersCount));
|
||||||
for(int i = 0; i < usersCount; i++) {
|
for (String user : users) {
|
||||||
String randomUserName = randomAlphaOfLengthBetween(1, 15);
|
createUser(user, MINIMAL_ACCESS_ROLE);
|
||||||
users.add(randomUserName);
|
|
||||||
createUser(randomUserName, MINIMAL_ACCESS_ROLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue