[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox-cvs
Subject:    [git commit] shells: fix exitcode_trapN tests to avoid races
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2020-02-26 8:05:52
Message-ID: 20200226075415.4B4C58E9B1 () busybox ! osuosl ! org
[Download RAW message or body]

commit: https://git.busybox.net/busybox/commit/?id=9aa751b08ab03d6396f86c3df77937a19687981b
                
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 shell/ash_test/ash-misc/exitcode_trap2.tests   | 3 +--
 shell/ash_test/ash-misc/exitcode_trap6.tests   | 3 +--
 shell/hush_test/hush-misc/exitcode_trap2.tests | 3 +--
 shell/hush_test/hush-misc/exitcode_trap6.tests | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/shell/ash_test/ash-misc/exitcode_trap2.tests \
b/shell/ash_test/ash-misc/exitcode_trap2.tests index f259774bf..aff6d5187 100755
--- a/shell/ash_test/ash-misc/exitcode_trap2.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
 $THIS_SH -c '
  trap "false;exit" term
  kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
 '
 echo 42:$?
diff --git a/shell/ash_test/ash-misc/exitcode_trap6.tests \
b/shell/ash_test/ash-misc/exitcode_trap6.tests index 15fb99d2d..59a07fc91 100755
--- a/shell/ash_test/ash-misc/exitcode_trap6.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
  trap "echo INT" int
  trap "kill -int $$;exit" term
  kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
 '
 echo 42:$?
diff --git a/shell/hush_test/hush-misc/exitcode_trap2.tests \
b/shell/hush_test/hush-misc/exitcode_trap2.tests index f259774bf..aff6d5187 100755
--- a/shell/hush_test/hush-misc/exitcode_trap2.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
 $THIS_SH -c '
  trap "false;exit" term
  kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
 '
 echo 42:$?
diff --git a/shell/hush_test/hush-misc/exitcode_trap6.tests \
b/shell/hush_test/hush-misc/exitcode_trap6.tests index 15fb99d2d..59a07fc91 100755
--- a/shell/hush_test/hush-misc/exitcode_trap6.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
  trap "echo INT" int
  trap "kill -int $$;exit" term
  kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
 '
 echo 42:$?
_______________________________________________
busybox-cvs mailing list
busybox-cvs@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic