Skip to content

Commit beedc42

Browse files
committed
preadv203: set max_runtime to 60s
Before the runtime patchset preadv203 uses 5min as default timeout per fs, that's really long enough for each test. But after that, it now only has 30s which is too short to finish the verify_preadv2() function that spins for at most 60 seconds. ==== Before ===== # ./preadv203 ... tst_test.c:1459: TINFO: Timeout per run is 0h 05m 00s preadv203.c:143: TINFO: Number of full_reads 2567, short reads 10, zero len reads 0, EAGAIN(s) 2530185 preadv203.c:180: TINFO: Number of writes 682740 preadv203.c:194: TINFO: Cache dropped 114 times preadv203.c:223: TPASS: Got some EAGAIN tst_test.c:1531: TINFO: Testing on ext3 tst_test.c:999: TINFO: Formatting /dev/loop0 with ext3 opts='' extra opts='' mke2fs 1.46.5 (30-Dec-2021) tst_test.c:1459: TINFO: Timeout per run is 0h 05m 00s ... ==== After ===== # ./preadv203 tst_device.c:89: TINFO: Found free device 0 '/dev/loop0' tst_test.c:1524: TINFO: Timeout per run is 0h 00m 30s tst_supported_fs_types.c:89: TINFO: Kernel supports ext2 ... tst_test.c:1597: TINFO: Testing on ext2 tst_test.c:1062: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts='' mke2fs 1.46.5 (30-Dec-2021) Test timeouted, sending SIGKILL! tst_test.c:1575: TINFO: If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1 tst_test.c:1577: TBROK: Test killed! (timeout?) Signed-off-by: Cyril Hrubis <[email protected]> Signed-off-by: Li Wang <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent c5b8b34 commit beedc42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testcases/kernel/syscalls/preadv2/preadv203.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ static void *cache_dropper(void *unused)
199199
static void verify_preadv2(void)
200200
{
201201
pthread_t reader, dropper, writer;
202-
unsigned int max_runtime = 600;
203202
void *eagains;
204203

205204
stop = 0;
@@ -210,7 +209,7 @@ static void verify_preadv2(void)
210209
SAFE_PTHREAD_CREATE(&reader, NULL, nowait_reader, NULL);
211210
SAFE_PTHREAD_CREATE(&writer, NULL, writer_thread, NULL);
212211

213-
while (!stop && max_runtime-- > 0)
212+
while (!stop && tst_remaining_runtime())
214213
usleep(100000);
215214

216215
stop = 1;
@@ -279,5 +278,6 @@ static struct tst_test test = {
279278
.mntpoint = MNTPOINT,
280279
.mount_device = 1,
281280
.all_filesystems = 1,
281+
.max_runtime = 60,
282282
.needs_root = 1,
283283
};

0 commit comments

Comments
 (0)