From 82e5acd6b30aabccb0a1e157dc633591c4919a3e Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Mon, 13 Aug 2018 15:11:15 -0400 Subject: tests: Fix spurious failures in stats-dump.t test The test fails to grep and find queue_size, in a brick stats dump, having succesfully found aggr.* values in the same. The troubleshot is that, the writer thread in io-stats, that dumps this in a particular interval, truncates the file just before the grep attempts to read the contents, and hence the failure. The fix is to stop the dumper thread, and then wait for a couple of seconds and then check the output, so that the thread writer does not interfere with the test. Fixes: bz#1615582 Change-Id: I29f95488a2ad693abe1dd525b1d87a9d1eee29a2 Signed-off-by: ShyamsundarR --- tests/basic/stats-dump.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/basic/stats-dump.t b/tests/basic/stats-dump.t index 3eed80e5579..054df2e636f 100644 --- a/tests/basic/stats-dump.t +++ b/tests/basic/stats-dump.t @@ -26,8 +26,16 @@ done for i in {1..10};do dd if=/dev/zero of=$N0/nfs_testfile$i bs=4k count=100 done + +# Wait for one dump interval to be done, some seconds past 1 that is the dump +# interval set sleep 2 +# Change the dump interval to 0, so that when reading the file contents we +# do not get them truncated by the next interval that is overwriting the latest +# stats data +TEST $CLI volume set $V0 diagnostics.stats-dump-interval 0 + # Verify we have non-zero write counts from the bricks, gNFSd # and the FUSE mount. TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfs_nfsd.dump|tail -1|cut -d: -f2) != "0," ] -- cgit