Skip to content

Commit 8ae3bd2

Browse files
committed
test: Fix unstable tests due to date in logs
The `cut` command stripping away the date of log messages broke at the beginning of the month due to using `' '` as a separator. Instead, we can count on the date format to always be 16 characters long and make the `cut` command more robust.
1 parent 6bfe3a2 commit 8ae3bd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/server-test-helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ run_server ()
1313
mkdir -p log data # Directories that might be required by the server
1414
dune build "$1"
1515
# Run the server in the background, cut the datetime out of the log output.
16-
dune exec -- "$@" 2>&1 | cut -d ' ' -f 4- &
16+
dune exec -- "$@" 2>&1 | cut -b 18- &
1717
# Wait for the unix-domain socket and the command-pipe to be created
1818
local timeout=50 # Don't wait more than 0.5s
1919
while ! ( [[ -e ./local.sock ]] && [[ -e ./local.cmd ]] ) && (( timeout-- > 0 )); do

0 commit comments

Comments
 (0)