From reviews-return-19290-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Wed Jan 6 17:54:28 2016 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-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 163BA18B67 for ; Wed, 6 Jan 2016 17:54:28 +0000 (UTC) Received: (qmail 50862 invoked by uid 500); 6 Jan 2016 17:54:27 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 50834 invoked by uid 500); 6 Jan 2016 17:54:27 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 50814 invoked by uid 99); 6 Jan 2016 17:54:27 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2016 17:54:27 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 33C7D2984F3; Wed, 6 Jan 2016 17:54:26 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6636130822776911602==" MIME-Version: 1.0 Subject: Review Request 41986: Fixed race in persistent volume tests. From: "Greg Mann" To: "Alexander Rukletsov" , "Jie Yu" , "Michael Park" Cc: "Greg Mann" , "mesos" Date: Wed, 06 Jan 2016 17:54:26 -0000 Message-ID: <20160106175426.1209.51520@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Greg Mann" X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/41986/ X-Sender: "Greg Mann" Reply-To: "Greg Mann" X-ReviewRequest-Repository: mesos --===============6636130822776911602== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41986/ ----------------------------------------------------------- Review request for mesos, Alexander Rukletsov, Jie Yu, and Michael Park. Bugs: MESOS-4208 https://issues.apache.org/jira/browse/MESOS-4208 Repository: mesos Description ------- Fixed race in persistent volume tests. This race occurred because `scheduelerDriver.reviveOffers` will trigger an offer immediately, while the tests originally assumed that settling and advancing the clock after reviving was necessary to produce an offer. Diffs ----- src/tests/persistent_volume_tests.cpp 2fb57814b2805bc76981d1877603a1a033f29289 Diff: https://reviews.apache.org/r/41986/diff/ Testing ------- In order to reproduce this bug, insert a short sleep onto line 1204 or line 1402 of `src/tests/persistent_volume_tests.cpp` - note that these line numbers refer to the file *before* applying this patch. The race is due to the fact that calling `reviveOffers` triggers a new offer, while the code is assuming that the clock must be settled and advanced before an offer will be sent. Thus, the offer may arrive before the `EXPECT_CALL` is executed, causing a previous `EXPECT_CALL` to be triggered more times than expected. By calling `EXPECT_CALL` before `reviveOffers`, this race is avoided. The unnecessary `Clock:settle` and `Clock::advance` calls have been removed as well. To test, `GTEST_FILTER="PersistentVolumeTest.BadACLDropCreateAndDestroy:PersistentVolumeTest.BadACLNoPrincipal" bin/mesos-tests.sh` was run both with and without `sleep(1);` inserted before the relevant `EXPECT_CALL`s. Thanks, Greg Mann --===============6636130822776911602==--