All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 3/4] lib: ignore SIGINT in _tst_kill_test
@ 2021-05-08  5:51 Li Wang
  2021-05-10 11:47 ` Cyril Hrubis
  2021-05-11  5:54 ` Joerg Vehlow
  0 siblings, 2 replies; 15+ messages in thread
From: Li Wang @ 2021-05-08  5:51 UTC (permalink / raw)
  To: ltp

We have to guarantee _tst_kill_test alive for a while to check if
the target test eixst or not, so ignore SIGINT in _tst_kill_test
is necessary, otherwise it will be stopped by the SIGINT sending
by itself.

The timeout03.sh verify this mechanism proccess well in output:

  timeout03 1 TBROK: Test timeouted, sending SIGINT! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1
  timeout03 1 TBROK: test interrupted or timed out
  timeout03 1 TPASS: test run cleanup after timeout
  timeout03 1 TINFO: Test is still running, waiting 10s
  timeout03 1 TINFO: Test is still running, waiting 9s
  timeout03 1 TINFO: Test is still running, waiting 8s
  timeout03 1 TINFO: Test is still running, waiting 7s
  timeout03 1 TINFO: Test is still running, waiting 6s
  timeout03 1 TINFO: Test is still running, waiting 5s
  timeout03 1 TINFO: Test is still running, waiting 4s
  timeout03 1 TINFO: Test is still running, waiting 3s
  timeout03 1 TINFO: Test is still running, waiting 2s
  timeout03 1 TINFO: Test is still running, waiting 1s
  timeout03 1 TBROK: Test still running, sending SIGKILL
  Killed

(This one based on Joerg's improvement work, better apply this after the two patches)

Fixes: 25ad54dbaea6("tst_test.sh: Run cleanup also after test timeout")
Signed-off-by: Li Wang <liwang@redhat.com>
Cc: Joerg Vehlow <lkml@jv-coder.de>
Acked-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index ed2699175..b6ca0cb26 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -439,6 +439,7 @@ _tst_kill_test()
 {
 	local i=10
 
+	trap '' INT
 	tst_res TBROK "Test timeouted, sending SIGINT! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1"
 	kill -INT -$pid
 	tst_sleep 100ms
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-18 12:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  5:51 [LTP] [PATCH v3 3/4] lib: ignore SIGINT in _tst_kill_test Li Wang
2021-05-10 11:47 ` Cyril Hrubis
2021-05-11  5:54 ` Joerg Vehlow
2021-05-12  9:49   ` Li Wang
2021-05-12 10:34     ` Joerg Vehlow
2021-05-12 14:20     ` Petr Vorel
2021-05-13  5:08       ` Li Wang
2021-05-14  7:53         ` Petr Vorel
2021-05-14  9:10           ` Li Wang
2021-05-14 15:10             ` Petr Vorel
2021-05-18  4:57         ` Joerg Vehlow
2021-05-18  7:27           ` Li Wang
2021-05-18  8:46             ` Petr Vorel
2021-05-18  9:45             ` Joerg Vehlow
2021-05-18 12:01               ` Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.