Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 55383 invoked from network); 14 Dec 2005 21:18:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Dec 2005 21:18:38 -0000 Received: (qmail 55881 invoked by uid 500); 14 Dec 2005 21:18:26 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 55806 invoked by uid 500); 14 Dec 2005 21:18:26 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 55782 invoked by uid 99); 14 Dec 2005 21:18:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2005 13:18:26 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jak-commons-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2005 13:18:25 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Emdyq-0007RS-Cm for commons-dev@jakarta.apache.org; Wed, 14 Dec 2005 22:16:08 +0100 Received: from p549aba9a.dip0.t-ipconnect.de ([84.154.186.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Dec 2005 22:16:08 +0100 Received: from joerg.schaible by p549aba9a.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Dec 2005 22:16:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: commons-dev@jakarta.apache.org To: commons-dev@jakarta.apache.org From: =?ISO-8859-1?Q?J=F6rg?= Schaible Subject: Re: Gump & VM (was: [POLL] System.currentTimeMillis()) Date: Wed, 14 Dec 2005 22:13:42 +0100 Lines: 33 Message-ID: References: Reply-To: joerg.schaible@gmx.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p549aba9a.dip0.t-ipconnect.de Mail-Copies-To: never User-Agent: KNode/0.9.3 Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N J�rg Schaible wrote: > 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 ... OK, I can analyse the situation. My current box was not totally synchronized and I had a daemon running, that adjusted the time smoothly. After compete synchronization the tests passes. Nevertheless, this does not solve the Gump problem, since I know, that they have often problems with the system time (we had last week one VM where 1 second exactly took 2 real ones). So what can we do? - J�rg --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org