File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,14 @@ SELECT "[ PASS ] Server has restarted.";
145145 my $file_trad= $ENV{'LOG_FILE_TRAD'};
146146 my $file_conv= $ENV{'LOG_FILE_JSON_TO_TRAD'};
147147
148+ # Two messages with timestamps differing by microseconds may arrive
149+ # in reverse order in the two sinks — even though both are correct and complete.
150+ # To avoid false failures, sort both logs before comparing.
151+ system("sort $file_trad -o $file_trad.sorted") == 0 or die "sort failed for $file_trad";
152+ rename("$file_trad.sorted", $file_trad) or die "rename failed for $file_trad: $!";
153+ system("sort $file_conv -o $file_conv.sorted") == 0 or die "sort failed for $file_conv";
154+ rename("$file_conv.sorted", $file_conv) or die "rename failed for $file_conv: $!";
155+
148156 my $compare = compare($file_conv, $file_trad);
149157
150158 if ($compare == 0) {
You can’t perform that action at this time.
0 commit comments