@@ -117,6 +117,7 @@ public void timeAndSize() throws Exception {
117117 int approxWritesPerPeriod = 64 ;
118118 sizeThreshold = prefix .length () * approxWritesPerPeriod ;
119119 loggerContext .putProperty ("sizeThreshold" , "" + sizeThreshold );
120+ System .out .println ("timeAndSize.sizeThreshold=" +sizeThreshold );
120121 loadConfig (ClassicTestConstants .JORAN_INPUT_PREFIX + "rolling/" + testId + ".xml" );
121122
122123 StatusPrinter .print (loggerContext );
@@ -135,7 +136,8 @@ public void timeAndSize() throws Exception {
135136 TimeBasedFileNamingAndTriggeringPolicy <ILoggingEvent > tbnatp = tprp .getTimeBasedFileNamingAndTriggeringPolicy ();
136137
137138 int timeIncrement = 1000 / approxWritesPerPeriod ;
138- int runLength = approxWritesPerPeriod * 3 ;
139+ int targetPeriodCount = 3 ;
140+ int runLength = approxWritesPerPeriod * targetPeriodCount ;
139141 for (int i = 0 ; i < runLength ; i ++) {
140142 String msg = prefix + i ;
141143 logger .debug (msg );
@@ -149,7 +151,7 @@ public void timeAndSize() throws Exception {
149151 // for various reasons, it is extremely difficult to have the files
150152 // match exactly the expected archive files. Thus, we aim for
151153 // an approximate match
152- assertTrue (eCount >= 4 && eCount > expectedFilenameList .size () / 2 ,
154+ assertTrue (eCount >= targetPeriodCount || eCount >= expectedFilenameList .size () / 2 ,
153155 "existenceCount=" + eCount + ", expectedFilenameList.size=" + expectedFilenameList .size ());
154156 }
155157
@@ -218,10 +220,10 @@ void addExpectedFileNamedIfItsTime(String testId, String msg, boolean gzExtensio
218220 void addExpectedFileName (String testId , Date date , int fileIndexCounter , boolean gzExtension ) {
219221
220222 String fn = randomOutputDir + testId + "-" + SDF .format (date ) + "." + fileIndexCounter ;
221- System .out .println ("Adding " + fn );
222223 if (gzExtension ) {
223224 fn += ".gz" ;
224225 }
226+ System .out .println ("Adding " + fn );
225227 expectedFilenameList .add (fn );
226228 }
227229
0 commit comments