Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 15BD0200CA8 for ; Thu, 15 Jun 2017 17:50:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 143A3160BDF; Thu, 15 Jun 2017 15:50:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5AC4E160BC4 for ; Thu, 15 Jun 2017 17:50:03 +0200 (CEST) Received: (qmail 62740 invoked by uid 500); 15 Jun 2017 15:50:02 -0000 Mailing-List: contact issues-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list issues@mesos.apache.org Received: (qmail 62730 invoked by uid 99); 15 Jun 2017 15:50:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 15:50:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 12E58188A93 for ; Thu, 15 Jun 2017 15:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id gSBeHLEUbCHi for ; Thu, 15 Jun 2017 15:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D626B5FC1C for ; Thu, 15 Jun 2017 15:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5947CE01D8 for ; Thu, 15 Jun 2017 15:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1202921E0C for ; Thu, 15 Jun 2017 15:50:00 +0000 (UTC) Date: Thu, 15 Jun 2017 15:50:00 +0000 (UTC) From: "Till Toenshoff (JIRA)" To: issues@mesos.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MESOS-5886) FUTURE_DISPATCH may react on irrelevant dispatch. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 15 Jun 2017 15:50:04 -0000 [ https://issues.apache.org/jira/browse/MESOS-5886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Till Toenshoff updated MESOS-5886: ---------------------------------- Affects Version/s: 1.4.0 1.3.0 1.1.2 1.2.1 Target Version/s: 1.4.0 > FUTURE_DISPATCH may react on irrelevant dispatch. > ------------------------------------------------- > > Key: MESOS-5886 > URL: https://issues.apache.org/jira/browse/MESOS-5886 > Project: Mesos > Issue Type: Bug > Affects Versions: 1.1.2, 1.2.1, 1.3.0, 1.4.0 > Reporter: Alexander Rukletsov > Assignee: Andrei Budnik > Labels: mesosphere, tech-debt, tech-debt-test > > [{{FUTURE_DISPATCH}}|https://github.com/apache/mesos/blob/e8ebbe5fe4189ef7ab046da2276a6abee41deeb2/3rdparty/libprocess/include/process/gmock.hpp#L50] uses [{{DispatchMatcher}}|https://github.com/apache/mesos/blob/e8ebbe5fe4189ef7ab046da2276a6abee41deeb2/3rdparty/libprocess/include/process/gmock.hpp#L350] to figure out whether a processed {{DispatchEvent}} is the same the user is waiting for. However, comparing {{std::type_info}} of function pointers is not enough: different class methods with same signatures will be matched. Here is the test that proves this: > {noformat} > class DispatchProcess : public Process > { > public: > MOCK_METHOD0(func0, void()); > MOCK_METHOD1(func1, bool(bool)); > MOCK_METHOD1(func1_same_but_different, bool(bool)); > MOCK_METHOD1(func2, Future(bool)); > MOCK_METHOD1(func3, int(int)); > MOCK_METHOD2(func4, Future(bool, int)); > }; > {noformat} > {noformat} > TEST(ProcessTest, DispatchMatch) > { > DispatchProcess process; > PID pid = spawn(&process); > Future future = FUTURE_DISPATCH( > pid, > &DispatchProcess::func1_same_but_different); > EXPECT_CALL(process, func1(_)) > .WillOnce(ReturnArg<0>()); > dispatch(pid, &DispatchProcess::func1, true); > AWAIT_READY(future); > terminate(pid); > wait(pid); > } > {noformat} > The test passes: > {noformat} > [ RUN ] ProcessTest.DispatchMatch > [ OK ] ProcessTest.DispatchMatch (1 ms) > {noformat} > This change was introduced in https://reviews.apache.org/r/28052/. -- This message was sent by Atlassian JIRA (v6.4.14#64029)