Return-Path: X-Original-To: apmail-aurora-reviews-archive@minotaur.apache.org Delivered-To: apmail-aurora-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D7431885C for ; Tue, 5 Jan 2016 03:56:48 +0000 (UTC) Received: (qmail 88536 invoked by uid 500); 5 Jan 2016 03:56:48 -0000 Delivered-To: apmail-aurora-reviews-archive@aurora.apache.org Received: (qmail 88494 invoked by uid 500); 5 Jan 2016 03:56:48 -0000 Mailing-List: contact reviews-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.apache.org Delivered-To: mailing list reviews@aurora.apache.org Received: (qmail 88474 invoked by uid 99); 5 Jan 2016 03:56:47 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2016 03:56:47 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id ABD56297AAC; Tue, 5 Jan 2016 03:56:46 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6500295238303818362==" MIME-Version: 1.0 Subject: Re: Review Request 41915: Fixup TaskObserverTest to respect thread memory models. From: "John Sirois" To: "Bill Farner" , "Maxim Khutornenko" Cc: "John Sirois" , "Aurora" Date: Tue, 05 Jan 2016 03:56:46 -0000 Message-ID: <20160105035646.26044.42341@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "John Sirois" X-ReviewGroup: Aurora X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/41915/ X-Sender: "John Sirois" References: <20160105030513.26044.3118@reviews.apache.org> In-Reply-To: <20160105030513.26044.3118@reviews.apache.org> Reply-To: "John Sirois" X-ReviewRequest-Repository: aurora --===============6500295238303818362== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Jan. 4, 2016, 8:05 p.m., John Sirois wrote: > > Another answer could be to delete this test altogether. It looks like it only really tests the proper converson from Time Amounts to fractional second waits. > > Bill Farner wrote: > I'm tempted to take this route as well. It's not clear to me what this test accomplishes, and it has the downside of high coupling to the implementation being tested. Maxim - your test originally so your call. For a refresh - see here: https://reviews.apache.org/r/35527/ - John ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41915/#review112748 ----------------------------------------------------------- On Jan. 4, 2016, 8:02 p.m., John Sirois wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41915/ > ----------------------------------------------------------- > > (Updated Jan. 4, 2016, 8:02 p.m.) > > > Review request for Aurora, Maxim Khutornenko and Bill Farner. > > > Bugs: AURORA-1570 > https://issues.apache.org/jira/browse/AURORA-1570 > > > Repository: aurora > > > Description > ------- > > Previously, a mock threading.Event was waited on in one thread > and the count of waits was read in another thread. Most thread > memory models do not guaranty reads are fresh in this scenario > unless there is a memory barrier of some sort forcing per-cpu > caches to be flushed. > > This change uses the underlying threading.Event as the memory > barrier instead of mocking it and just wraps the event to record > calls manually. > > src/main/python/apache/thermos/observer/task_observer.py | 5 +++-- > src/test/python/apache/thermos/observer/test_task_observer.py | 36 ++++++++++++++++++++++++------------ > 2 files changed, 27 insertions(+), 14 deletions(-) > > > Diffs > ----- > > src/main/python/apache/thermos/observer/task_observer.py 1485de8faef52716f11b82a3556064de26c67427 > src/test/python/apache/thermos/observer/test_task_observer.py ace15c5305e75fac3a82971f4d71b92bcb37bafc > > Diff: https://reviews.apache.org/r/41915/diff/ > > > Testing > ------- > > Before this change I got a failure between 1/5 and 1/10th of the > time via: > ``` > while true > do > ./pants test src/test/python/apache/thermos/observer/ -- -kTaskObserverTest > done > ``` > > After the change I cannot trigger the failure. > > > Thanks, > > John Sirois > > --===============6500295238303818362==--