@@ -385,9 +385,9 @@ private void createSessions(Main main) throws Exception {
385385
386386 @ Test
387387 public void testCreatingOneMillionUsers () throws Exception {
388- // if (System.getenv("ONE_MILLION_USERS_TEST") == null) {
389- // return;
390- // }
388+ if (System .getenv ("ONE_MILLION_USERS_TEST" ) == null ) {
389+ return ;
390+ }
391391
392392 String [] args = {"../" };
393393 TestingProcessManager .TestingProcess process = TestingProcessManager .start (args , false );
@@ -449,24 +449,13 @@ public void testCreatingOneMillionUsers() throws Exception {
449449 primaryUserIdMappings .clear ();
450450
451451 process .kill (false );
452+ assertNotNull (process .checkOrWaitForEvent (ProcessState .PROCESS_STATE .STOPPED ));
452453
453454 Runtime .getRuntime ().gc ();
454455 System .gc ();
455456 System .runFinalization ();
456457 Thread .sleep (10000 );
457-
458- process = TestingProcessManager .start (args , false );
459- Utils .setValueInConfig ("firebase_password_hashing_signer_key" ,
460- "gRhC3eDeQOdyEn4bMd9c6kxguWVmcIVq/SKa0JDPFeM6TcEevkaW56sIWfx88OHbJKnCXdWscZx0l2WbCJ1wbg==" );
461- Utils .setValueInConfig ("postgresql_connection_pool_size" , "500" );
462-
463- FeatureFlagTestContent .getInstance (process .getProcess ())
464- .setKeyValue (FeatureFlagTestContent .ENABLED_FEATURES , new EE_FEATURES []{
465- EE_FEATURES .ACCOUNT_LINKING , EE_FEATURES .MULTI_TENANCY });
466- process .startProcess ();
467- assertNotNull (process .checkOrWaitForEvent (ProcessState .PROCESS_STATE .STARTED ));
468458
469- process .kill (false );
470459 process = TestingProcessManager .start (args , false );
471460 Utils .setValueInConfig ("firebase_password_hashing_signer_key" ,
472461 "gRhC3eDeQOdyEn4bMd9c6kxguWVmcIVq/SKa0JDPFeM6TcEevkaW56sIWfx88OHbJKnCXdWscZx0l2WbCJ1wbg==" );
@@ -503,8 +492,15 @@ public void testCreatingOneMillionUsers() throws Exception {
503492 memoryCheckRunning .set (false );
504493 memoryChecker .join ();
505494
495+ Thread .sleep (5000 );
496+
497+ Runtime rt = Runtime .getRuntime ();
498+ long total_mem = rt .totalMemory ();
499+ long free_mem = rt .freeMemory ();
500+ long used_mem = total_mem - free_mem ;
501+
506502 System .out .println ("Max memory used: " + (maxMemory .get () / (1024 * 1024 )) + " MB" );
507- assert maxMemory . get () < 256 * 1024 * 1024 ; // must be less than 256 mb
503+ System . out . println ( "Current Memory user: " + ( used_mem / ( 1024 * 1024 )) + " MB" );
508504
509505 process .kill ();
510506 assertNotNull (process .checkOrWaitForEvent (ProcessState .PROCESS_STATE .STOPPED ));
0 commit comments