From dcc39a7b25ae14ec4c7a0ecf716f1046063f0230 Mon Sep 17 00:00:00 2001 From: lantz Date: Mon, 4 Jan 2021 18:25:35 -0800 Subject: [PATCH] Loosen test_intfoptions tolerance to 25% for CI (#998) Adjusting the tolerance for this test to compensate for apparent performance variation when running as part of github actions CI builds/tests. --- examples/test/test_intfoptions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/test/test_intfoptions.py b/examples/test/test_intfoptions.py index 35b45cd..531925e 100755 --- a/examples/test/test_intfoptions.py +++ b/examples/test/test_intfoptions.py @@ -13,7 +13,7 @@ class testIntfOptions( unittest.TestCase ): def testIntfOptions( self ): "verify that intf.config is correctly limiting traffic" p = pexpect.spawn( 'python -m mininet.examples.intfoptions ' ) - tolerance = .2 # plus or minus 20% + tolerance = .25 # plus or minus 25% for cloud CI tests opts = [ "Results: \['([\d\.]+) .bits/sec", "Results: \['10M', '([\d\.]+) .bits/sec", "h(\d+)->h(\d+): (\d)/(\d)," @@ -30,8 +30,10 @@ class testIntfOptions( unittest.TestCase ): BW = 10 measuredBw = float( p.match.group( 1 ) ) loss = ( measuredBw / BW ) * 100 - self.assertGreaterEqual( loss, 50 * ( 1 - tolerance ) ) - self.assertLessEqual( loss, 50 * ( 1 + tolerance ) ) + self.assertGreaterEqual( loss, 50 * ( 1 - tolerance ), + 'loss of %d%% << 50%%' % loss ) + self.assertLessEqual( loss, 50 * ( 1 + tolerance ), + 'loss of %d%% >> 50%%' % loss ) elif index == 2: delay = float( p.match.group( 6 ) ) self.assertGreaterEqual( delay, 15 * ( 1 - tolerance ) )