From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 151D01F640 for ; Mon, 30 Jan 2023 04:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1675053059; bh=NX9QGLeuwu6MUnG2e8cJcl9PQpByU7jfd791UEyyPEI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M9Kg63X8SCDZYAh7Xib/bRdc88sZte6fX21y3j0jL02wvQ9cgbwauLZN0Gv32tTI4 Jj2VBK71ZXVJO8miOGIplbT3mw2BanfPocaNs0HBFOAeh5f8UFWK2JE+eo11QPOFPQ 70iQMDfNDd7h4uKkkDZ5fA/PWrSjY514OhjuLch4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] tests: make slow tests easier-to-find Date: Mon, 30 Jan 2023 04:30:58 +0000 Message-Id: <20230130043058.3464867-3-e@80x24.org> In-Reply-To: <20230130043058.3464867-1-e@80x24.org> References: <20230130043058.3464867-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: t/run.perl now prints slowest 10 tests at startup, and I've added ./devel/longest-tests to print all tests sorted by elapsed time. This should allow us to notice outliers more quickly in the future. --- MANIFEST | 1 + devel/longest-tests | 7 +++++++ t/run.perl | 4 ++++ 3 files changed, 12 insertions(+) create mode 100755 devel/longest-tests diff --git a/MANIFEST b/MANIFEST index c494d6f7..a0c74dfa 100644 --- a/MANIFEST +++ b/MANIFEST @@ -121,6 +121,7 @@ contrib/css/README contrib/selinux/el7/publicinbox.fc contrib/selinux/el7/publicinbox.te devel/README +devel/longest-tests devel/syscall-list examples/README examples/README.unsubscribe diff --git a/devel/longest-tests b/devel/longest-tests new file mode 100755 index 00000000..bf46e166 --- /dev/null +++ b/devel/longest-tests @@ -0,0 +1,7 @@ +eval 'exec perl -wS $0 ${1+"$@"}' # this script is too short to copyright +if 0; # running under some shell +use v5.12; use autodie; use YAML::XS qw(Load); +open(my $fh, '<', shift // '.prove'); +my $t = Load(do { local $/; <$fh> })->{tests}; +my @t = sort { $t->{$b}->{elapsed} <=> $t->{$a}->{elapsed} } keys %$t; +printf "%0.6f %s\n", $t->{$_}->{elapsed}, $_ for @t; diff --git a/t/run.perl b/t/run.perl index b90715a6..f68dab60 100755 --- a/t/run.perl +++ b/t/run.perl @@ -85,6 +85,10 @@ if ($shuffle) { @tests = sort { ($t->{$b}->{elapsed} // 0) <=> ($t->{$a}->{elapsed} // 0) } @tests; + say "# top 10 longest tests (`make check' regenerates)"; + for (@tests[0..9]) { + printf "# %0.6f %s\n", $t->{$_}->{elapsed}, $_; + } } our $tb = Test::More->builder;