@@ -117,6 +117,7 @@ public void timeAndSize() throws Exception {
117
117
int approxWritesPerPeriod = 64 ;
118
118
sizeThreshold = prefix .length () * approxWritesPerPeriod ;
119
119
loggerContext .putProperty ("sizeThreshold" , "" + sizeThreshold );
120
+ System .out .println ("timeAndSize.sizeThreshold=" +sizeThreshold );
120
121
loadConfig (ClassicTestConstants .JORAN_INPUT_PREFIX + "rolling/" + testId + ".xml" );
121
122
122
123
StatusPrinter .print (loggerContext );
@@ -135,7 +136,8 @@ public void timeAndSize() throws Exception {
135
136
TimeBasedFileNamingAndTriggeringPolicy <ILoggingEvent > tbnatp = tprp .getTimeBasedFileNamingAndTriggeringPolicy ();
136
137
137
138
int timeIncrement = 1000 / approxWritesPerPeriod ;
138
- int runLength = approxWritesPerPeriod * 3 ;
139
+ int targetPeriodCount = 3 ;
140
+ int runLength = approxWritesPerPeriod * targetPeriodCount ;
139
141
for (int i = 0 ; i < runLength ; i ++) {
140
142
String msg = prefix + i ;
141
143
logger .debug (msg );
@@ -149,7 +151,7 @@ public void timeAndSize() throws Exception {
149
151
// for various reasons, it is extremely difficult to have the files
150
152
// match exactly the expected archive files. Thus, we aim for
151
153
// an approximate match
152
- assertTrue (eCount >= 4 && eCount > expectedFilenameList .size () / 2 ,
154
+ assertTrue (eCount >= targetPeriodCount || eCount >= expectedFilenameList .size () / 2 ,
153
155
"existenceCount=" + eCount + ", expectedFilenameList.size=" + expectedFilenameList .size ());
154
156
}
155
157
@@ -218,10 +220,10 @@ void addExpectedFileNamedIfItsTime(String testId, String msg, boolean gzExtensio
218
220
void addExpectedFileName (String testId , Date date , int fileIndexCounter , boolean gzExtension ) {
219
221
220
222
String fn = randomOutputDir + testId + "-" + SDF .format (date ) + "." + fileIndexCounter ;
221
- System .out .println ("Adding " + fn );
222
223
if (gzExtension ) {
223
224
fn += ".gz" ;
224
225
}
226
+ System .out .println ("Adding " + fn );
225
227
expectedFilenameList .add (fn );
226
228
}
227
229
0 commit comments