]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Add a test checking memory consumption of container vuzlov/26455
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 11 Oct 2021 13:29:03 +0000 (15:29 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 11 Oct 2021 13:29:03 +0000 (15:29 +0200)
src/Container/Test/testcontainer.py

index 3789420ed7f91cb8ed7d8a04f52a6d2104467e0a..5eb7b255f60b9f85fe1d3526ac56208290a9bb65 100644 (file)
@@ -96,7 +96,20 @@ class TestResourceManager(unittest.TestCase):
         self.assertGreater(memory_total, memory_in_use)
         self.assertGreater(memory_in_use, memory_by_me)
         cont.Shutdown()
-
+    
+    def test5(self):
+        """
+        Test checking memory consumption of container
+        """
+        cont = self.getContainer("test_container_5")
+        memory_by_me_start = cont.getTotalPhysicalMemoryInUseByMe()
+        import pickle
+        psn = cont.createPyScriptNode("n","""b = bytearray(10485760)""")# create 10MB byte array abroad
+        psn.execute([],pickle.dumps(((),{})))
+        memory_by_me_end = cont.getTotalPhysicalMemoryInUseByMe()
+        self.assertGreater(memory_by_me_end,memory_by_me_start)
+        self.assertIn(memory_by_me_end-memory_by_me_start,[10,11,12])# test elevation of memory
+        cont.Shutdown()
 
 if __name__ == '__main__':
     salome.standalone()