Skip to content

Commit

Permalink
fix: fixing the OneMillionUsersTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tamassoltesz committed Dec 19, 2024
1 parent c2ed495 commit fdc7ed3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,10 @@ private static long measureTime(Supplier<Void> function) {

@Test
public void testWithOneMillionUsers() throws Exception {
if (System.getenv("ONE_MILLION_USERS_TEST") == null) {
return;
}

Main main = startCronProcess(String.valueOf(NUM_THREADS));

int NUMBER_OF_USERS_TO_UPLOAD = 1000000; // million
Expand All @@ -1004,6 +1008,7 @@ public void testWithOneMillionUsers() throws Exception {
JsonObject request = generateUsersJson(10000, i * 10000); // API allows 10k users upload at once
JsonObject response = uploadBulkImportUsersJson(main, request);
assertEquals("OK", response.get("status").getAsString());
System.out.println("Uploaded " + (i + 1) * 10000 + " users");
}

}
Expand All @@ -1028,7 +1033,7 @@ public void testWithOneMillionUsers() throws Exception {
int failedUsersNumber = loadBulkImportUsersCountWithStatus(main,
BulkImportStorage.BULK_IMPORT_USER_STATUS.FAILED).get("count").getAsInt();
count = newUsersNumber + processingUsersNumber;

System.out.println("Remaining users to process: " + count + " (new: " + newUsersNumber + ", processing: " + processingUsersNumber + ", failed: " + failedUsersNumber + ")");
if (count == 0) {
break;
}
Expand Down

0 comments on commit fdc7ed3

Please sign in to comment.