From 9818b781e0bcc852cd0568cf563564c795dd16f4 Mon Sep 17 00:00:00 2001 From: Mykola F <37578614+mykolaf@users.noreply.github.com> Date: Sat, 4 May 2019 05:19:08 +0300 Subject: [PATCH] [test_watermark] avoid watermark clear vs test random failure (#873) Signed-off-by: Mykola Faryma --- tests/test_watermark.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_watermark.py b/tests/test_watermark.py index 80602929c9a9..79b8fa98810c 100644 --- a/tests/test_watermark.py +++ b/tests/test_watermark.py @@ -188,8 +188,9 @@ def test_clear(self, dvs): # clear pg shared watermark, and verify that headroom watermark and persistent watermarks are not affected - dvs.runcmd("sonic-clear priority-group watermark shared") - + exitcode, output = dvs.runcmd("sonic-clear priority-group watermark shared") + time.sleep(1) + assert exitcode == 0, "CLI failure: %s" % output # make sure it cleared self.verify_value(dvs, self.pgs, WmTables.user, SaiWmStats.pg_shared, "0") @@ -201,7 +202,9 @@ def test_clear(self, dvs): # clear queue unicast persistent watermark, and verify that multicast watermark and user watermarks are not affected - dvs.runcmd("sonic-clear queue persistent-watermark unicast") + exitcode, output = dvs.runcmd("sonic-clear queue persistent-watermark unicast") + time.sleep(1) + assert exitcode == 0, "CLI failure: %s" % output # make sure it cleared self.verify_value(dvs, self.uc_q, WmTables.persistent, SaiWmStats.queue_shared, "0")