← Commit list

d0545d223a

Graham Campbell
Graham Campbell
2026-07-15
SUCCESS Duration: 200s

Subject

runtests: flush cached test parts when (re)loading a file

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

tests/ftpserver.pl+2 -1
@@ -3142,7 +3142,8 @@ while(1) {
$| = 1;
&customize(); # read test control instructions
- loadtest("$logdir/test$testno");
+ # force a reload, a test retry may have regenerated the file
+ loadtest("$logdir/test$testno", 0, 1);
my $welcome = $commandreply{"welcome"};
if(!$welcome) {
tests/getpart.pm+8 -3
@@ -44,7 +44,7 @@ BEGIN {
);
}
-use Memoize;
+use Memoize qw(memoize flush_cache);
my @xml; # test data file contents
my $xmlfile; # test data filename
@@ -199,9 +199,9 @@ sub partexists {
# memoize('partexists', NORMALIZER => 'normalize_part'); # cache each result
sub loadtest {
- my ($file, $original) = @_;
+ my ($file, $original, $force) = @_;
- if(defined $xmlfile && $file eq $xmlfile) {
+ if(!$force && defined $xmlfile && $file eq $xmlfile) {
# This test is already loaded
return
}
@@ -209,6 +209,11 @@ sub loadtest {
undef @xml;
$xmlfile = "";
+ # flush results cached from an earlier load, the file may have been
+ # regenerated since with new variable substitutions
+ flush_cache('getpart');
+ flush_cache('getpartattr');
+
if(open(my $xmlh, "<", $file)) {
if($original) {
binmode $xmlh, ':crlf';
tests/runner.pm+2 -2
@@ -655,8 +655,8 @@ sub singletest_preprocess {
}
close($fulltesth) or die "Failure writing test file";
- # in case the process changed the file, reload it
- loadtest("$LOGDIR/test${testnum}");
+ # in case the process changed the file, force a reload
+ loadtest("$LOGDIR/test${testnum}", 0, 1);
}
#######################################################################