Ejemplo n.º 1
0
    def test_log_download_view(self):
        # download and view using each node, just to see we can
        # each overwrites
        for h in h2o.nodes:
            h.log_view()
            # checkH2OLogs will download
            # h.log_download(timeoutSecs=5)

        # this gets them all thru node 0

        # new logs from tom. check all are there and right size?
        # kevin@Kevin-Ubuntu4:~/h2o/py/testdir_multi_jvm/sandbox/h2ologs_20140926_111658$ unzip node0*
        # unzips to
        # ~/h2o/py/testdir_multi_jvm/sandbox/h2ologs_20140926_111658/sandbox/ice.WkGicq/h2ologs

        # Archive:  node0_172.16.2.222_54321.zip
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-4-warn.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-5-error.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-httpd.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-3-info.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-2-debug.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-6-fatal.log
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-1-trace.log

        (logNameList, lineCountList) = h2o_log.checkH2OLogs(timeoutSecs=180)

        self.assertEqual(len(logNameList), len(h2o.nodes),
                         "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes),
                         "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d 1-trace log is too small" % i)
    def test_log_download_terminate2(self):

        # download and view using each node
        for h in h2o.nodes:
            h.log_view()
            h.log_download(timeoutSecs=3)

        # terminate node 1
        h2o.nodes[1].terminate_self_only()

        # wait to make sure heartbeat updates cloud status
        time.sleep(5)

        (logNameList, lineCountList) = h2o_log.checkH2OLogs()
        nodesNum = len(h2o.nodes)
        self.assertEqual(len(logNameList), nodesNum,
                         "Should be " + nodesNum + " logs")
        self.assertEqual(len(lineCountList), nodesNum,
                         "Should be " + nodesNum + " logs")

        for i in range(nodesNum):
            # line counts seem to vary..check for "too small"
            # variance in polling (cloud building and status)?
            self.assertGreater(lineCountList[i], 12,
                               "node " + str(i) + " log is too small")
Ejemplo n.º 3
0
    def test_log_download_view(self):
        # download and view using each node, just to see we can
        # each overwrites
        for h in h2o.nodes:
            h.log_view()
            # checkH2OLogs will download
            # h.log_download(timeoutSecs=5)

        # this gets them all thru node 0

        # new logs from tom. check all are there and right size?
        # kevin@Kevin-Ubuntu4:~/h2o/py/testdir_multi_jvm/sandbox/h2ologs_20140926_111658$ unzip node0*
        # unzips to 
        # ~/h2o/py/testdir_multi_jvm/sandbox/h2ologs_20140926_111658/sandbox/ice.WkGicq/h2ologs

        # Archive:  node0_172.16.2.222_54321.zip
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-4-warn.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-5-error.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-httpd.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-3-info.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-2-debug.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-6-fatal.log  
        #   inflating: sandbox/ice.WkGicq/h2ologs/h2o_172.16.2.222_54321-1-trace.log 

        (logNameList, lineCountList) = h2o_log.checkH2OLogs(timeoutSecs=180)

        self.assertEqual(len(logNameList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d 1-trace log is too small" % i)
Ejemplo n.º 4
0
    def test_log_download_view(self):
        (logNameList, lineCountList) = h2o_log.checkH2OLogs()

        self.assertEqual(len(logNameList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d log is too small" % i)
Ejemplo n.º 5
0
    def test_log_download_view(self):
        (logNameList, lineCountList) = h2o_log.checkH2OLogs()

        self.assertEqual(len(logNameList), 3, "Should be 3 logs")
        self.assertEqual(len(lineCountList), 3, "Should be 3 logs")
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        self.assertGreater(lineCountList[0], 12, "node 0 log is too small")
        self.assertGreater(lineCountList[1], 12, "node 1 log is too small")
        self.assertGreater(lineCountList[2], 12, "node 2 log is too small")
Ejemplo n.º 6
0
    def test_log_download_view(self):
        (logNameList, lineCountList) = h2o_log.checkH2OLogs()

        self.assertEqual(len(logNameList), len(h2o.nodes),
                         "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes),
                         "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d log is too small" % i)
Ejemplo n.º 7
0
    def test_log_download_view(self):
        # download and view using each node, just to see we can
        # each overwrites
        for h in h2o.nodes:
            h.log_view()
            h.log_download(timeoutSecs=5)

        # this gets them all thru node 0
        (logNameList, lineCountList) = h2o_log.checkH2OLogs()

        self.assertEqual(len(logNameList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d log is too small" % i)
Ejemplo n.º 8
0
    def test_log_download_view(self):
        # download and view using each node, just to see we can
        # each overwrites
        for h in h2o.nodes:
            h.log_view()
            # checkH2OLogs will download
            # h.log_download(timeoutSecs=5)

        # this gets them all thru node 0
        (logNameList, lineCountList) = h2o_log.checkH2OLogs()

        self.assertEqual(len(logNameList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        self.assertEqual(len(lineCountList), len(h2o.nodes), "Should be %d logs" % len(h2o.nodes))
        # line counts seem to vary..check for "too small"
        # variance in polling (cloud building and status)?
        for i, l in enumerate(lineCountList):
            self.assertGreater(l, 12, "node %d log is too small" % i)
    def test_log_download_terminate2(self):

        # download and view using each node
        for h in h2o.nodes:
            h.log_view()
            h.log_download(timeoutSecs=3)

        # terminate node 1
        h2o.nodes[1].terminate_self_only()

        # wait to make sure heartbeat updates cloud status
        time.sleep(5)

        (logNameList, lineCountList) = h2o_log.checkH2OLogs()
        nodesNum = len(h2o.nodes)
        self.assertEqual(len(logNameList), nodesNum, "Should be " + nodesNum + " logs")
        self.assertEqual(len(lineCountList), nodesNum, "Should be " + nodesNum + " logs")

        for i in range(nodesNum):
            # line counts seem to vary..check for "too small"
            # variance in polling (cloud building and status)?
            self.assertGreater(lineCountList[i], 12, "node " + str(i) + " log is too small")
Ejemplo n.º 10
0
    def test_log_download_terminate(self):
        csvPathnamegz = h2o.find_file('smalldata/hhp_9_17_12.predict.data.gz')
        h2o_cmd.runRF(trees=6, timeoutSecs=30, csvPathname=csvPathnamegz)

        # download and view using each node
        for h in h2o.nodes:
            h.log_view()
            h.log_download(timeoutSecs=3)

        # terminate node 1
        h2o.nodes[1].terminate_self_only()

        # wait to make sure heartbeat updates cloud status
        time.sleep(5)

        print "Checking cloud size at nodes 0 and 2 after terminating 1"
        nodesNow = [h2o.nodes[0], h2o.nodes[2]]
        expectedSize = len(nodesNow)
        cloudSizes = [n.get_cloud()['cloud_size'] for n in nodesNow]
        cloudConsensus = [n.get_cloud()['consensus'] for n in nodesNow]
        for s in cloudSizes:
            consensusStr = (",".join(map(str,cloudConsensus)))
            sizeStr =   (",".join(map(str,cloudSizes)))
            if (s != expectedSize):
                raise Exception("Inconsistent cloud size." +
                    "nodes report size: %s consensus: %s instead of %d." % \
                    (sizeStr, consensusStr, expectedSize))

        (logNameList, lineCountList) = h2o_log.checkH2OLogs()
        nodesNum = len(h2o.nodes)
        self.assertEqual(len(logNameList), nodesNum, "Should be " + nodesNum + " logs")
        self.assertEqual(len(lineCountList), nodesNum, "Should be " + nodesNum + " logs")

        for i in range(nodesNum):
            # line counts seem to vary..check for "too small"
            # variance in polling (cloud building and status)?
            self.assertGreater(lineCountList[i], 12, "node " + str(i) + " log is too small")