Skip to content

Commit

Permalink
tests: Use $(MKDIR_P) to avoid races.
Browse files Browse the repository at this point in the history
"test -d x || mkdir x" has a race when invoked in parallel: it is possible
for two processes to both see that 'x' does not exist and both try to
create it, and if that happens then one of them will fail.  This avoids
the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
  • Loading branch information
blp committed Dec 6, 2017
1 parent e7b9b17 commit d3aed72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/automake.mk
Expand Up @@ -207,7 +207,7 @@ valgrind_wrappers = \
tests/valgrind/test-vconn

$(valgrind_wrappers): tests/valgrind-wrapper.in
@test -d tests/valgrind || mkdir tests/valgrind
@$(MKDIR_P) tests/valgrind
$(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
$(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
chmod +x $@.tmp && \
Expand Down

0 comments on commit d3aed72

Please sign in to comment.