Permalink
Browse files

Give nc used in the ganglia test, a chance to start.

  • Loading branch information...
1 parent e577ba1 commit a9145d56806add24d34325d8270ba3bfa136e863 @alq666 alq666 committed May 25, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −0 tests/test_ganglia.py
  2. +1 −2 tests/test_varnish.py
View
@@ -10,6 +10,7 @@
import tempfile
from hashlib import md5
from util import json
+import time
from checks.ganglia import Ganglia
@@ -19,6 +20,8 @@ class TestGanglia(unittest.TestCase):
def testSpeed(self):
# Pretend to be gmetad and serve a large piece of content
server = subprocess.Popen("nc -l 8651 < %s" % TEST_FN, shell=True)
+ # Wait for 1 second
+ time.sleep(1)
pfile = tempfile.NamedTemporaryFile()
g = Ganglia(logging.getLogger('tests'))
View
@@ -1847,9 +1847,8 @@ def setUp(self):
def testParsing(self):
v = Varnish(logging.getLogger("tests"))
v._parse_varnishstat(self.v_dump, False)
- self.assertEquals(v.get_sample("varnish.LCK.vbe.locks"), 1.90)
self.assertEquals(v.get_sample("varnish.n_waitinglist"), 980)
- self.assertEquals(len(v.get_metrics()), len(self.v_dump.split("\n")))
+ self.assertRaises(UnknownValue, v.get_sample, "varnish.fetch_length")
# XML parsing
v._parse_varnishstat(self.xml_dump, True)

0 comments on commit a9145d5

Please sign in to comment.