Skip to content

Commit

Permalink
tlitest: extend delay for limit-action delay test
Browse files Browse the repository at this point in the history
In some environments the limit-action delay test listed below is
failing:

test_record_fast_input_with_limit_action_delay

This requires more time to write to the output log file set by
tlog-rec in the test.  In order to accomplish this, the check_outfile
misc function is modified to take a parameter called maxchecks which can
be used to set how many times to check for a string in the file in
between the 5 second delays.

For the limit-action delay test, this is set to 100 to wait long enough
to catch the last message being written to the log file.
  • Loading branch information
spoore1 authored and justin-stephenson committed May 3, 2021
1 parent 31f198c commit 3897015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/tlitest/misc.py
Expand Up @@ -47,10 +47,10 @@ def check_journal(pattern):
assert pattern in out_txt


def check_outfile(pattern, filename):
def check_outfile(pattern, filename, maxchecks=10):
""" Check that file contains pattern """
time.sleep(1)
for _ in range(0, 10):
for _ in range(0, maxchecks):
file1 = open(filename, 'r')
content = file1.read()
file1.close()
Expand Down
2 changes: 1 addition & 1 deletion lib/tlitest/test_tlog_rec_perf_opts.py
Expand Up @@ -99,7 +99,7 @@ def test_record_fast_input_with_limit_action_delay(self):
'-o {} /bin/bash'.format(opts, logfile))
for num in range(0, 200):
shell.sendline('echo test_{}'.format(num))
check_outfile('test_199', logfile)
check_outfile('test_199', logfile, maxchecks=100)
shell.sendline('exit')
check_recording(shell, 'test_199', logfile)
shell.close()
Expand Down

0 comments on commit 3897015

Please sign in to comment.