From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] shell: Prevent orphan timeout sleep processes
Date: Fri, 7 May 2021 16:22:33 +0200 [thread overview]
Message-ID: <YJVNKebKn6jTvyG/@pevik> (raw)
In-Reply-To: <CAEemH2fucJPyeTL-HZJD92ves7GLMaMHcaPzi8kS_qWL+x=Hcg@mail.gmail.com>
Hi Li, Joerg,
thanks both for your work!
> +++ b/lib/newlib_tests/shell/timeout03.sh
> @@ -32,7 +32,7 @@ do_test()
> {
> tst_res TINFO "testing killing test after TST_TIMEOUT"
> - tst_sleep 2
> + sleep 2
+1
Although tst_test.sh has many LTP custom binary dependencies I agree to use
simple sleep for seconds.
> tst_res TFAIL "test: running after TST_TIMEOUT"
> }
> @@ -40,7 +40,7 @@ cleanup()
> {
> tst_res TPASS "test run cleanup after timeout"
> - tst_sleep 15 # must be higher than wait time in _tst_kill_test
> + sleep 15 # must be higher than wait time in _tst_kill_test
and here.
> tst_res TFAIL "cleanup: running after TST_TIMEOUT"
> }
> diff --git a/lib/newlib_tests/shell/timeout04.sh
> b/lib/newlib_tests/shell/timeout04.sh
> index 0a6ba053c..c702905f3 100755
> --- a/lib/newlib_tests/shell/timeout04.sh
> +++ b/lib/newlib_tests/shell/timeout04.sh
> @@ -9,7 +9,7 @@ TST_TIMEOUT=1
> do_test()
> {
> - tst_res TINFO "Start"
> + tst_res TINFO "Start"
> sleep 5
> tst_res TFAIL "End"
> }
> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index 7ceddff04..ed2699175 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -469,7 +469,7 @@ _tst_timeout_process()
> sleep $sec &
> sleep_pid=$!
> - #trap "kill $sleep_pid; exit" TERM
> + trap "kill $sleep_pid; exit" TERM
I guess trap use is needed, and commented out for testing.
> wait $sleep_pid
> _tst_kill_test
> }
> ================
> (This below is not related to your patches)
> But there is another issue I found that the timeout03 can NOT
> be killed after timed out in calling cleanup(), the reason is
> tst_brk stop the _tst_kill_test running in the background so that
> it does not output as what we expected:
Good catch, I'll try to have a look as well.
Kind regards,
Petr
> # timeout03 1 TINFO: timeout per run is 0h 0m 1s
> # timeout03 1 TINFO: testing killing test after TST_TIMEOUT
> # 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
next prev parent reply other threads:[~2021-05-07 14:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-07 10:32 [LTP] [PATCH v2 0/3] shell: Fix orphan timeout sleep processes Joerg Vehlow
2021-05-07 10:32 ` [LTP] [PATCH v2 1/2] shell: Extend timeout tests Joerg Vehlow
2021-05-07 10:32 ` [LTP] [PATCH v2 2/2] shell: Prevent orphan timeout sleep processes Joerg Vehlow
2021-05-07 14:08 ` Li Wang
2021-05-07 14:22 ` Petr Vorel [this message]
2021-05-07 14:31 ` Li Wang
2021-05-07 15:39 ` Petr Vorel
2021-05-08 3:57 ` Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YJVNKebKn6jTvyG/@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox