From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Stancek Date: Wed, 23 Oct 2019 09:28:26 -0400 (EDT) Subject: [LTP] [PATCH] lsmod01.sh: retry test couple times to lower false positives In-Reply-To: <20191023121901.GA25868@dell5510> References: <20191023121901.GA25868@dell5510> Message-ID: <463301336.8732968.1571837306503.JavaMail.zimbra@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it ----- Original Message ----- > > > - tst_res TPASS "'lsmod' passed." > > +lsmod_test() > > +{ > > + for i in $(seq 1 5); do > > + if lsmod_matches_proc_modules; then > > + tst_res TPASS "'lsmod' passed." > > + return > > + fi > > + tst_res TINFO "Trying again" > > + sleep 1 > > + done > This is similar pattern to TST_RETRY_FUNC()/TST_RETRY_FN_EXP_BACKOFF() > (for both shell and C). I wonder if we also have use for TPASS/TFAIL > instead of just TBROK and specifying number of tries instead of time to be > setup. I think TFAIL fits more here, it's outcome of what we are testing. TBROK in my mind is failure unrelated to subject of test. But functionally TST_RETRY_FUNC should work too. > C and shell usage is a bit different, so maybe > TST_RETRY_FUNC()/TST_RETRY_FN_EXP_BACKOFF() doesn't make much sense for shell I see it used in mkswap01.sh and numa01.sh. I wonder if we need to TBROK in TST_RETRY_FUNC(). We could just return what the FUNC returns and let the test decide. TST_RETRY_FUNC_BRK() could be a wrapper that TBROKs on timeout.