From: Anthony Geay Date: Mon, 11 Oct 2021 13:29:03 +0000 (+0200) Subject: Add a test checking memory consumption of container X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c7289833848ba5003c7493f9d15a9f5518e457eb;p=modules%2Fkernel.git Add a test checking memory consumption of container --- diff --git a/src/Container/Test/testcontainer.py b/src/Container/Test/testcontainer.py index 3789420ed..5eb7b255f 100644 --- a/src/Container/Test/testcontainer.py +++ b/src/Container/Test/testcontainer.py @@ -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()