[ARVADOS] updated: 857d5a70bcff7d3634d6daf9886fdfe6d46d681c

git at public.curoverse.com git at public.curoverse.com
Thu Feb 12 11:43:42 EST 2015


Summary of changes:
 services/nodemanager/tests/test_daemon.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

       via  857d5a70bcff7d3634d6daf9886fdfe6d46d681c (commit)
      from  d4b03f2476f0ea6b30baad78672b31938846853e (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 857d5a70bcff7d3634d6daf9886fdfe6d46d681c
Author: Brett Smith <brett at curoverse.com>
Date:   Thu Feb 12 11:43:38 2015 -0500

    Node Manager daemon tests avoid checking monitor.is_alive().
    
    Checking is_alive() creates race conditions, because we might check
    the actor's live state before it's had a chance to process a stop
    message in its queue.  We just had a build fail because of this:
    <https://ci.curoverse.com/job/arvados-api-server/1299/>.  Always check
    that a monitor is alive by sending it a real message.  No issue #.

diff --git a/services/nodemanager/tests/test_daemon.py b/services/nodemanager/tests/test_daemon.py
index 96fcde9..bdba83a 100644
--- a/services/nodemanager/tests/test_daemon.py
+++ b/services/nodemanager/tests/test_daemon.py
@@ -49,8 +49,18 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
     def monitor_list(self):
         return pykka.ActorRegistry.get_by_class(ComputeNodeMonitorActor)
 
+    def monitored_arvados_nodes(self):
+        pairings = []
+        for future in [actor.proxy().arvados_node
+                       for actor in self.monitor_list()]:
+            try:
+                pairings.append(future.get(self.TIMEOUT))
+            except pykka.ActorDeadError:
+                pass
+        return pairings
+
     def alive_monitor_count(self):
-        return sum(1 for actor in self.monitor_list() if actor.is_alive())
+        return len(self.monitored_arvados_nodes())
 
     def assertShutdownCancellable(self, expected=True):
         self.assertTrue(self.node_shutdown.start.called)
@@ -65,9 +75,7 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
         self.assertTrue(self.node_setup.start.called)
 
     def check_monitors_arvados_nodes(self, *arv_nodes):
-        pairings = [monitor.proxy().arvados_node
-                    for monitor in self.monitor_list() if monitor.is_alive()]
-        self.assertItemsEqual(arv_nodes, pykka.get_all(pairings, self.TIMEOUT))
+        self.assertItemsEqual(arv_nodes, self.monitored_arvados_nodes())
 
     def test_node_pairing(self):
         cloud_node = testutil.cloud_node_mock(1)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list