Skip to content

Commit 789eec5

Browse files
committed
Merge remote-tracking branch 'origin/topic/awelzel/faster-btest-run-bg-and-wait'
* origin/topic/awelzel/faster-btest-run-bg-and-wait: Make btest-bg-run delay configurable Make btest-bg-wait more responsive
2 parents 9302f28 + 27f5987 commit 789eec5

File tree

7 files changed

+25
-7
lines changed

7 files changed

+25
-7
lines changed

CHANGES

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
1.2-7 | 2025-03-20 10:09:16 +0100
2+
3+
* Make btest-bg-run delay configurable (Arne Welzel, Corelight)
4+
5+
Allow users to remove the unconditional sleep 1 by introducing
6+
a new environment variable BTEST_BG_RUN_SLEEP that specifies the
7+
amount of seconds to sleep. If tests are written robustly, setting
8+
this to 0 can speed up execution of btest-bg-run heavy test suites.
9+
10+
* Make btest-bg-wait more responsive (Arne Welzel, Corelight)
11+
12+
Sleep 10 msec instead of 1 second to check for process termination to
13+
make detecting process termination a bit more timely.
14+
115
1.2-4 | 2025-01-29 09:03:57 -0700
216

317
* Require CMake 3.15, inline with other Zeek projects (Tim Wojtulewicz, Corelight)

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
..
33
.. Version number is filled in automatically.
44

5-
.. |version| replace:: 1.2-4
5+
.. |version| replace:: 1.2-7
66

77
==================================================
88
BTest - A Generic Driver for Powerful System Tests

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2-4
1+
1.2-7

btest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ else:
5656
import multiprocessing.managers as mp_managers
5757
import multiprocessing.sharedctypes as mp_sharedctypes
5858

59-
VERSION = "1.2-4" # Automatically filled in.
59+
VERSION = "1.2-7" # Automatically filled in.
6060

6161
Name = "btest"
6262
Config = None

btest-bg-run

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
# and spawns <cmdline> in there in the background. It also records
77
# a set of meta information that btest-bg-wait will read.
88

9+
# Sleep this many seconds after creating the process and before
10+
# returning from btest-bg-run.
11+
BTEST_BG_RUN_SLEEP=${BTEST_BG_RUN_SLEEP:-1}
12+
913
if [ "$#" -le 1 ]; then
1014
echo "usage: $(basename "$0") <tag> <cmdline>"
1115
exit 1
@@ -33,4 +37,4 @@ echo "$@" >.cmdline
3337

3438
$setsid "$helper" "$@" >.stdout 2>.stderr &
3539

36-
sleep 1
40+
sleep "$BTEST_BG_RUN_SLEEP"

btest-bg-wait

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ $# != 1 ]; then
2525
exit 1
2626
fi
2727

28-
timeout=$1
28+
timeout=$(($1 * 100))
2929

3030
procs=$(cat .bgprocs)
3131

@@ -122,7 +122,7 @@ while true; do
122122
exit 1
123123
fi
124124

125-
sleep 1
125+
sleep 0.01
126126
done
127127

128128
trap - EXIT

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
py_modules = ["btest-sphinx"]
66

77
setup(
8-
version="1.2.dev4", # Filled in automatically.
8+
version="1.2.dev7", # Filled in automatically.
99
py_modules=py_modules,
1010
)

0 commit comments

Comments
 (0)