Skip to content

Commit bbe5239

Browse files
committed
Try to improve script's performance; removed regression/misc/10-tfn-cache.t
1 parent b9b4de1 commit bbe5239

File tree

2 files changed

+8
-189
lines changed

2 files changed

+8
-189
lines changed

tests/regression/misc/10-tfn-cache.t

Lines changed: 0 additions & 187 deletions
This file was deleted.

tests/run-regression-tests.pl.in

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,16 @@ sub match_log {
474474
#dbg("Match \"$re\" in $name \"$$rbuf\" ($n)");
475475
if ($$rbuf =~ m/$re/m) {
476476
$rc = $&;
477+
# clear buffer
478+
$$rbuf =~ s/.*$re//sm;
477479
last;
478480
}
479-
# TODO: Use select()/poll()
480-
sleep 0.1 unless ($nbytes == $BUFSIZ);
481+
unless ($nbytes == $BUFSIZ) {
482+
# wait until we can read from the file but max 0.1 secs
483+
my $rin = '';
484+
vec($rin, fileno($fh), 1) = 1;
485+
select($rin, undef, undef, 0.1);
486+
}
481487
if ($graph and $opt{d}) {
482488
$i++;
483489
if ($i == 10) {

0 commit comments

Comments
 (0)