gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/test/gzz/mem partition.test


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/test/gzz/mem partition.test
Date: Thu, 09 Jan 2003 02:06:24 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/01/09 02:06:24

Modified files:
        test/gzz/mem   : partition.test 

Log message:
        One more test... seems things are all right here.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/mem/partition.test.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: gzz/test/gzz/mem/partition.test
diff -u gzz/test/gzz/mem/partition.test:1.4 gzz/test/gzz/mem/partition.test:1.5
--- gzz/test/gzz/mem/partition.test:1.4 Wed Jan  8 10:38:53 2003
+++ gzz/test/gzz/mem/partition.test     Thu Jan  9 02:06:24 2003
@@ -20,11 +20,11 @@
     def getQuality(self):
        return self.qual
 
-def waitFor(f):
+def waitFor(f, dontStop = 0):
     for i in range(0,20):
        java.lang.Thread.sleep(50)
        if f():
-           pool.stop()
+           if not dontStop: pool.stop()
            return
     pool.stop()
     failUnless(0)
@@ -53,4 +53,20 @@
     pool.request(d, .5, 1, None)
 
     waitFor(lambda: b.rese == 230 and d.rese == 230 and 1 < c.rese < 220 )
+
+def testChange():
+    """Test that the partitioner reacts to new requests.
+    """
+    b = Reserver()
+    c = Reserver()
+    d = Reserver()
+
+    pool.request(b, .5, 1, None)
+    pool.request(c, .25, 1, None)
+    pool.request(d, .5, 1, None)
+
+    waitFor(lambda: b.rese == 230 and d.rese == 230 and 1 < c.rese < 220, 
dontStop=1 )
+
+    pool.request(c, 1, 1, None)
+    waitFor(lambda: c.rese == 230 and b.rese + d.rese <= 500 - 230 )
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]