[LTP] [PATCH] swapping01: set .max_runtime to 90 seconds

Li Wang liwang@redhat.com
Fri Jun 17 07:56:00 CEST 2022


This fix can significantly improve timeouts on slower systems:

  # free -h
                total        used        free      shared  buff/cache   available
  Mem:          2.9Gi       1.1Gi       1.1Gi        20Mi       732Mi       1.5Gi
  Swap:         2.0Gi          0B       2.0Gi

  # time ./swapping01
  tst_kconfig.c:82: TINFO: Parsing kernel config '/boot/config-4.18.0-309.el8.x86_64+debug'
  tst_test.c:1528: TINFO: Timeout per run is 0h 02m 00s
  swapping01.c:110: TINFO: available physical memory: 1545 MB
  swapping01.c:113: TINFO: try to allocate: 2008 MB
  swapping01.c:152: TPASS: no heavy swapping detected, 218 MB swapped.
  ...

  real    0m34.241s
  user    0m0.386s
  sys     0m16.040s

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/mem/swapping/swapping01.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index f6133cc0d..73bad5d6a 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -159,6 +159,7 @@ static struct tst_test test = {
 	.needs_root = 1,
 	.forks_child = 1,
 	.min_mem_avail = 10,
+	.max_runtime = 90,
 	.test_all = test_swapping,
 	.needs_kconfigs = (const char *[]) {
 		"CONFIG_SWAP=y",
-- 
2.35.3



More information about the ltp mailing list