From 230f18b6e1094003c7f65c74a82bf8e76ecd5517 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Tue, 16 Nov 2021 09:57:54 -0800 Subject: [PATCH] Improve parallel test suite runner (#9160) Summary: * Parallel `make check` would pass if a test binary failed to list gtest tests. This is now likely to report as a failure. * Crazy perl was generating some extra incorrect test names causing extra files and binary invocations. Fixed with cleaner awk. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9160 Test Plan: For first part, add an 'assert(false);' to start of hash_test main and see 'make check' pass before, and fail after. For second part, inspect t/ directory before vs. after. Number of executed tests is same: $ cat log* | grep 'PASSED.*test' | awk '{ tot += $4; } END { print tot; }' 10469 Reviewed By: ajkr Differential Revision: D32372006 Pulled By: pdillinger fbshipit-source-id: 185b3db2b67e3f9198eb75322e4d0493e4fc1beb --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 544fbf1e0d..26cc02dd4e 100644 --- a/Makefile +++ b/Makefile @@ -825,11 +825,8 @@ parallel_tests = $(patsubst %,parallel_%,$(PARALLEL_TEST)) $(parallel_tests): $(PARALLEL_TEST) $(AM_V_at)TEST_BINARY=$(patsubst parallel_%,%,$@); \ TEST_NAMES=` \ - ./$$TEST_BINARY --gtest_list_tests \ - | perl -n \ - -e 's/ *\#.*//;' \ - -e '/^(\s*)(\S+)/; !$$1 and do {$$p=$$2; break};' \ - -e 'print qq! $$p$$2!'`; \ + (./$$TEST_BINARY --gtest_list_tests || echo " $${TEST_BINARY}__list_tests_failure") \ + | awk '/^[^ ]/ { prefix = $$1 } /^[ ]/ { print prefix $$1 }'`; \ for TEST_NAME in $$TEST_NAMES; do \ TEST_SCRIPT=t/run-$$TEST_BINARY-$${TEST_NAME//\//-}; \ echo " GEN " $$TEST_SCRIPT; \