Skip to content

Commit 771757a

Browse files
committed
Fixup for 17b665d: remove 'sleep' hack & fix race condition in tests
17b665d was a failed attempt to hack around a race condition by lengthening a 'sleep'; this simply made the problem appear less frequently. The problem only occurred in the toolchanger/toolno-pocket-differ/* tests. Comparing with other successful linuxcncrsh-based tests turned up 9748fe9 and the "set wait done" command, which clears up the problem, even with the original 'sleep' hack removed.
1 parent 3555609 commit 771757a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

scripts/linuxcnc.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ if ! program_available $EMCSERVER; then
600600
fi
601601
export INI_FILE_NAME="$INIFILE"
602602
$EMCSERVER -ini "$INIFILE" &
603-
# give linuxcnc *five* seconds to finish: race condition alert!
604-
sleep 5
605603

606604
# 4.3.2. Start REALTIME
607605
echo "Loading Real Time OS, RTAPI, and HAL_LIB modules" >>$PRINT_FILE

tests/toolchanger/toolno-pocket-differ/shared-test.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ fi
4444
echo 'set mdi m100 P3 Q#5400' # toolno
4545
echo 'set mdi m100 P4 Q#5403' # TLO z
4646
echo 'set mdi m100 P5' # blank line
47+
echo "set wait done"
4748
}
4849

4950
echo hello EMC mt 1.0
@@ -150,10 +151,6 @@ fi
150151
echo set mdi g43
151152
introspect 30
152153

153-
154-
# give linuxcnc a second to finish
155-
sleep 1.0
156-
157154
echo shutdown
158155
) | nc localhost 5007
159156

0 commit comments

Comments
 (0)