Skip to content

Commit

Permalink
fix: one million users
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Mar 13, 2024
1 parent 68cb492 commit c91dea7
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ private void createSessions(Main main) throws Exception {

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

String[] args = {"../"};
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args, false);
Expand Down Expand Up @@ -443,13 +443,18 @@ public void testCreatingOneMillionUsers() throws Exception {
}

sanityCheckAPIs(process.getProcess());
allUserIds.clear();
allPrimaryUserIds.clear();
userIdMappings.clear();
primaryUserIdMappings.clear();

process.kill(false);

Runtime.getRuntime().gc();
System.gc();
System.runFinalization();
Thread.sleep(10000);

process.kill(false);

process = TestingProcessManager.start(args, false);
Utils.setValueInConfig("firebase_password_hashing_signer_key",
"gRhC3eDeQOdyEn4bMd9c6kxguWVmcIVq/SKa0JDPFeM6TcEevkaW56sIWfx88OHbJKnCXdWscZx0l2WbCJ1wbg==");
Expand Down Expand Up @@ -487,7 +492,7 @@ public void testCreatingOneMillionUsers() throws Exception {
memoryChecker.join();

System.out.println("Max memory used: " + (maxMemory.get() / (1024 * 1024)) + " MB");
assert maxMemory.get() < 256 * 1024 * 1024; // must be less than 320 mb
assert maxMemory.get() < 256 * 1024 * 1024; // must be less than 256 mb

process.kill();
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STOPPED));
Expand Down

0 comments on commit c91dea7

Please sign in to comment.