[ARVADOS] updated: 7e8b0267597a52063395d3c258d4d4772d2e2240

git at public.curoverse.com git at public.curoverse.com
Tue Nov 11 16:06:49 EST 2014


Summary of changes:
 services/nodemanager/tests/test_jobqueue.py | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

       via  7e8b0267597a52063395d3c258d4d4772d2e2240 (commit)
      from  ca136c579fc014b6428c18cc3a74a45550539543 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7e8b0267597a52063395d3c258d4d4772d2e2240
Author: Tim Pierce <twp at curoverse.com>
Date:   Tue Nov 11 15:59:23 2014 -0500

    4294: additional unit tests
    
    test_server_calc_returns_min_nodes_for_one_job
    * Ensures that the @ServerCalculator@ still returns a wishlist with
    _min_nodes_ when there is a job in the queue.
    
    test_server_calc_more_jobs_than_min_nodes
    * Tests that when the job queue has between _min_nodes_ and _max_nodes_ in
    it, @ServerCalculator@ returns a wishlist exactly as long as the job
    queue.

diff --git a/services/nodemanager/tests/test_jobqueue.py b/services/nodemanager/tests/test_jobqueue.py
index 6b5f532..ae5bf1e 100644
--- a/services/nodemanager/tests/test_jobqueue.py
+++ b/services/nodemanager/tests/test_jobqueue.py
@@ -48,10 +48,23 @@ class ServerCalculatorTestCase(unittest.TestCase):
                                   {'min_scratch_mb_per_node': 200})
         self.assertEqual(6, len(servlist))
 
-    def test_server_calc_returns_at_least_min_nodes(self):
-        servcalc = self.make_calculator([1], min_nodes=5, max_nodes=9)
+    def test_server_calc_min_nodes_0_jobs(self):
+        servcalc = self.make_calculator([1], min_nodes=3, max_nodes=9)
         servlist = self.calculate(servcalc, {})
-        self.assertEqual(5, len(servlist))
+        self.assertEqual(3, len(servlist))
+
+    def test_server_calc_min_nodes_1_job(self):
+        servcalc = self.make_calculator([1], min_nodes=3, max_nodes=9)
+        servlist = self.calculate(servcalc, {'min_nodes': 1})
+        self.assertEqual(3, len(servlist))
+
+    def test_server_calc_more_jobs_than_min_nodes(self):
+        servcalc = self.make_calculator([1], min_nodes=2, max_nodes=9)
+        servlist = self.calculate(servcalc,
+                                  {'min_nodes': 1},
+                                  {'min_nodes': 1},
+                                  {'min_nodes': 1})
+        self.assertEqual(3, len(servlist))
 
     def test_job_requesting_max_nodes_accepted(self):
         servcalc = self.make_calculator([1], max_nodes=4)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list