コード例 #1
0
 def testGetDefaultConcurrencyExplicit(self, cpuCountMock, phymemUsageMock,
                                       *_args):
   """Concurrency when it is explicitly specified."""
   self.assertEqual(model_scheduler_service._getDefaultConcurrency(7), 7)
   self.assertFalse(cpuCountMock.called)
   self.assertFalse(phymemUsageMock.called)
コード例 #2
0
 def testGetDefaultConcurrencyMinimalMemory1(self, cpuCountMock,
                                             phymemUsageMock, *_args):
   """Default concurrency when there is minimal memory after base memory."""
   self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
   cpuCountMock.assert_called_once_with()
   phymemUsageMock.assert_called_once_with()
コード例 #3
0
 def testGetDefaultConcurrencyMinimalMemory2(self, cpuCountMock,
                                             phymemUsageMock, *_args):
   """Default concurrency when there is less memory than base allocation."""
   self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
   cpuCountMock.assert_called_once_with()
   phymemUsageMock.assert_called_once_with()
コード例 #4
0
 def testGetDefaultConcurrencyOneCpu(self, cpuCountMock, phymemUsageMock,
                                     *_args):
   """Default concurrency with one CPU."""
   self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
   cpuCountMock.assert_called_once_with()
   phymemUsageMock.assert_called_once_with()
コード例 #5
0
 def testGetDefaultConcurrencyMemoryBound(self, cpuCountMock, phymemUsageMock,
                                          *_args):
   """Default concurrency when memory bound."""
   self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
   cpuCountMock.assert_called_once_with()
   phymemUsageMock.assert_called_once_with()
コード例 #6
0
 def testGetDefaultConcurrencyExplicit(self, cpuCountMock, phymemUsageMock,
                                       *_args):
     """Concurrency when it is explicitly specified."""
     self.assertEqual(model_scheduler_service._getDefaultConcurrency(7), 7)
     self.assertFalse(cpuCountMock.called)
     self.assertFalse(phymemUsageMock.called)
コード例 #7
0
 def testGetDefaultConcurrencyMinimalMemory2(self, cpuCountMock,
                                             phymemUsageMock, *_args):
     """Default concurrency when there is less memory than base allocation."""
     self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
     cpuCountMock.assert_called_once_with()
     phymemUsageMock.assert_called_once_with()
コード例 #8
0
 def testGetDefaultConcurrencyMinimalMemory1(self, cpuCountMock,
                                             phymemUsageMock, *_args):
     """Default concurrency when there is minimal memory after base memory."""
     self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
     cpuCountMock.assert_called_once_with()
     phymemUsageMock.assert_called_once_with()
コード例 #9
0
 def testGetDefaultConcurrencyMemoryBound(self, cpuCountMock,
                                          phymemUsageMock, *_args):
     """Default concurrency when memory bound."""
     self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
     cpuCountMock.assert_called_once_with()
     phymemUsageMock.assert_called_once_with()
コード例 #10
0
 def testGetDefaultConcurrencyOneCpu(self, cpuCountMock, phymemUsageMock,
                                     *_args):
     """Default concurrency with one CPU."""
     self.assertEqual(model_scheduler_service._getDefaultConcurrency(), 2)
     cpuCountMock.assert_called_once_with()
     phymemUsageMock.assert_called_once_with()