Hi Joerg,

I just tried it on my box (linux, suse 9.3, 2.6.11.4-21.9-smp
kernel) and I don't have a problem; I did slightly modify the
test to run it standalone:

public class Test {

public static final void main(String[] args) throws Exception {
        long last = System.currentTimeMillis();
        System.out.println("start is " + last);

        for (int i = 0; i < 50000; i++) {
            long now = System.currentTimeMillis();
            assert(now >= last);
            last = now;
        }

        System.out.println("end is " + last);
    }

}

Cheers,
- Filip


> Hi folks,
>
> I have written a generator for commons-id, that is based in the end on the
> system clock. Unfortunately I have sporadic failures in Gump that I cannot
> explain. I developed this on a Windows box, but had now a chance for a
> test
> with Linux. Suddenly I have also sporadic failing tests. First I thought
> my
> algorithm is flawed, but then I wrote this little unit test:
>
>
>     public void testSystemTimeIsIncreasing() {
>         long last = System.currentTimeMillis();
>         for (int i = 0; i < 50000; i++) {
>             long now = System.currentTimeMillis();
>             assertTrue("Iteration " + i,  now >= last);
>             last = now;
>         }
>     }
>
>
> Believe it or not, this test will quite always fail within the first 10000
> iterations on my Linux box. So how does this test behave on your boxes?
> Please also note OS and JDK ...
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to