Occasional failure is no good of course, sorry about that.
I disliked that the test loops for 10 seconds first, and only then checks
if rollover succeeded.

I made a more robust version now. I see you just committed something
similar, I'll add to that.


On Sun, May 18, 2014 at 2:47 PM, Ralph Goers <[email protected]>wrote:

> Please revert this change. It now occasionally fails on my machine. The
> reason for the loop is to avoid those failures.
>
> Ralph
>
> On May 17, 2014, at 9:00 AM, [email protected] wrote:
>
> > Author: rpopma
> > Date: Sat May 17 16:00:06 2014
> > New Revision: 1595502
> >
> > URL: http://svn.apache.org/r1595502
> > Log:
> > performance improvement: reduce to a single sleep() long enough to
> trigger a rollover (speedup from 11 to 2.3 seconds)
> >
> > Modified:
> >
>  
> logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
> >
> > Modified:
> logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
> > URL:
> http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java?rev=1595502&r1=1595501&r2=1595502&view=diff
> >
> ==============================================================================
> > ---
> logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
> (original)
> > +++
> logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
> Sat May 17 16:00:06 2014
> > @@ -58,12 +58,10 @@ public class RollingAppenderTimeTest {
> >
> >     @Test
> >     public void testAppender() throws Exception {
> > -        for (int i=0; i < 100; ++i) {
> > -            if (i % 11 == 0) {
> > -                Thread.sleep(1000);
> > -            }
> > -            logger.debug("This is test message number " + i);
> > -        }
> > +        logger.debug("This is test message number 1");
> > +        Thread.sleep(1500);
> > +        logger.debug("This is test message number 2");
> > +
> >         final File dir = new File(DIR);
> >         assertTrue("Directory not created", dir.exists() &&
> dir.listFiles().length > 0);
> >         final File[] files = dir.listFiles();
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to