Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144414236
D21519.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21519.id.diff
View Options
Index: head/usr.bin/procstat/tests/procstat_test.sh
===================================================================
--- head/usr.bin/procstat/tests/procstat_test.sh
+++ head/usr.bin/procstat/tests/procstat_test.sh
@@ -25,7 +25,6 @@
# $FreeBSD$
#
-MAX_TRIES=20
PROG_PID=
PROG_PATH=$(atf_get_srcdir)/while1
@@ -37,16 +36,13 @@
PROG_COMM=while1
PROG_PATH=$(atf_get_srcdir)/$PROG_COMM
- $PROG_PATH $* &
+ mkfifo wait_for_start || atf_fail "mkfifo"
+ $PROG_PATH $* >wait_for_start &
PROG_PID=$!
- try=0
- while [ $try -lt $MAX_TRIES ] && ! kill -0 $PROG_PID; do
- sleep 0.5
- : $(( try += 1 ))
- done
- if [ $try -ge $MAX_TRIES ]; then
- atf_fail "Polled for program start $MAX_TRIES tries and failed"
+ if ! read dummy <wait_for_start; then
+ atf_fail "Program did not start properly"
fi
+ rm wait_for_start
}
atf_test_case binary_info
@@ -78,8 +74,6 @@
}
command_line_arguments_body()
{
- atf_skip "https://bugs.freebsd.org/233587"
-
arguments="my arguments"
start_program $arguments
@@ -104,8 +98,6 @@
}
environment_body()
{
- atf_skip "https://bugs.freebsd.org/233588"
-
var="MY_VARIABLE=foo"
eval "export $var"
Index: head/usr.bin/procstat/tests/while1.c
===================================================================
--- head/usr.bin/procstat/tests/while1.c
+++ head/usr.bin/procstat/tests/while1.c
@@ -33,7 +33,8 @@
main(void)
{
+ if (write(STDOUT_FILENO, "started\n", 8) != 8)
+ abort();
for (;;)
- usleep(100);
- exit(1);
+ pause();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 7:51 AM (18 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28527214
Default Alt Text
D21519.id.diff (1 KB)
Attached To
Mode
D21519: procstat/tests: Fix flakiness by waiting for program to start
Attached
Detach File
Event Timeline
Log In to Comment