Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 45446 invoked from network); 8 Feb 2007 10:57:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2007 10:57:18 -0000 Received: (qmail 33179 invoked by uid 500); 8 Feb 2007 10:57:22 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 33154 invoked by uid 500); 8 Feb 2007 10:57:22 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 33145 invoked by uid 99); 8 Feb 2007 10:57:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 02:57:22 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of elena.semukhina@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 02:57:12 -0800 Received: by nf-out-0910.google.com with SMTP id d4so792808nfe for ; Thu, 08 Feb 2007 02:56:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=i8S0gqaQp3r1ZLWjZApG/Lj3P12kuGsBZ1y48yq/A7Hlt4U30Rebhy/6PQuhfJKYpD0tkaQmlt+2QXAYaN73Sv/qUAZx7i91lm3k2dwVY31XbrNQ+F1qUuFEzTUklJ34LKIVF0TnqvVDA+xjmskr3B9W5SfLH6BK8BIuMWllLx0= Received: by 10.82.136.4 with SMTP id j4mr2478197bud.1170932211303; Thu, 08 Feb 2007 02:56:51 -0800 (PST) Received: by 10.82.138.10 with HTTP; Thu, 8 Feb 2007 02:56:51 -0800 (PST) Message-ID: Date: Thu, 8 Feb 2007 16:56:51 +0600 From: "Elena Semukhina" To: dev@harmony.apache.org Subject: Re: [testing][drlvm] smoke test gc.WeakReferenceTest failed today on winXP In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23322_26697677.1170932211267" References: <7273946b0701290108o28a4dbd2vfe3d5b2b669b82d7@mail.gmail.com> <783bf8b0701300658u641bdf60vda87194b53c45119@mail.gmail.com> <783bf8b0701300729i5cb5f306x80eb49c9c64cf6df@mail.gmail.com> <7273946b0701310321w5ae5579fib5fbcfab009f2275@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_23322_26697677.1170932211267 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/8/07, Gregory Shimansky wrote: > > Elena Semukhina wrote: > > On 2/7/07, Salikh Zakirov wrote: > >> > >> Gregory Shimansky wrote: > >> > Elena Semukhina wrote: > >> >> I managed to reproduce the failure on my Windows XP laptop. W'd > >> >> suggest that > >> >> we change the test so that it waits a little after gc() as Pavel > >> pointed > >> >> out. > >> > > >> > Spec says in [1] that > >> > > >> > ------------------- > >> > Some time after the garbage collector determines that the > reachability > >> > of the referent has changed to the value corresponding to the type of > >> > the reference, it will add the reference to the associated queue. At > >> > this point, the reference is considered to be enqueued. > >> > ------------------- > >> > > >> > The problem is with defining "some time". If spec says nothing about > >> how > >> > much time later the reference is enqueued, then it is not possible to > >> > test such event consistently. I am afraid this test is simply > incorrect > >> > and cannot be used. > >> > > >> > [1] > >> > > >> > http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/package-summary.html > >> > >> > >> I would suggest defining "some time" as a call to > System.runFinalization > >> (). > >> It's specification does not mention weak references at all, but it is > >> highly > >> likely that finalization subsystem is coupled with weak references > >> handling, > >> so expectation of references being enqueued together with finalization > >> is not ungrounded. > >> At least on DRLVM, this should work. > >> > >> And again, if the references wasn't enqueued after > >> > >> System.gc(); System.runFinalization(); > >> > >> on DRLVM, then it would look like a real bug. > >> > >> > > I tried this approach and it seems working on DRLVM. I ran tests many > times > > and they always passed. Do we all agree to change WeakReferenceTest and > > PhantomReferenceTest so that to remove sleep() at all and add > > System.runFinalization() instead? > > +1 for this. Using sleep in tests always makes me allergic. https://issues.apache.org/jira/browse/HARMONY-3137 created. Please review! Elena -- > Gregory > > -- Thanks, Elena ------=_Part_23322_26697677.1170932211267--