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 BDBDA200D2F for ; Wed, 1 Nov 2017 16:09:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BC4EE160BEA; Wed, 1 Nov 2017 15:09:45 +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 D9A56160BE6 for ; Wed, 1 Nov 2017 16:09:44 +0100 (CET) Received: (qmail 22628 invoked by uid 500); 1 Nov 2017 15:09:44 -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 22613 invoked by uid 99); 1 Nov 2017 15:09:43 -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; Wed, 01 Nov 2017 15:09:43 +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 1090C183405; Wed, 1 Nov 2017 15:09:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.201 X-Spam-Level: **** X-Spam-Status: No, score=4.201 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, NML_ADSP_CUSTOM_MED=1.2, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id e6Q6FBPdlODN; Wed, 1 Nov 2017 15:09:39 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 73C4760F72; Wed, 1 Nov 2017 15:09:38 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BC332E00A3; Wed, 1 Nov 2017 15:09:37 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id D6E47C4098E; Wed, 1 Nov 2017 15:09:35 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2244212622087326697==" MIME-Version: 1.0 Subject: Re: Review Request 62837: Added a test `DefaultExecutorTest.KillMultipleTasks`. From: Alexander Rukletsov To: Vinod Kone Cc: Gaston Kleiman , mesos , Mesos Reviewbot , Qian Zhang , Alexander Rukletsov , Mesos Reviewbot Windows Date: Wed, 01 Nov 2017 15:09:35 -0000 Message-ID: <20171101150935.32367.48255@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Alexander Rukletsov X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/62837/ X-Sender: Alexander Rukletsov References: <20171101150025.28996.56075@reviews-vm2.apache.org> In-Reply-To: <20171101150025.28996.56075@reviews-vm2.apache.org> Reply-To: Alexander Rukletsov X-ReviewRequest-Repository: mesos archived-at: Wed, 01 Nov 2017 15:09:45 -0000 --===============2244212622087326697== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Nov. 1, 2017, 3 p.m., Gaston Kleiman wrote: > > src/tests/default_executor_tests.cpp > > Lines 538-548 (patched) > > > > > > This is racy; there's no guarantee that the first `TASK_RUNNING` status update will come after the second `TASK_STARTING` update. > > > > The following ordering would also be possible: [`TASK_STARTING`, `TASK_RUNNING`, `TASK_STARTING`, `TASK_RUNNING`, ...] To simplify the logic here, let's introduce a matcher in our tests, something like ``` MATCHER_P(TaskStateEq, state, "") { return arg.state() == state; } ``` which we then can use like ``` Future status; EXPECT_CALL(sched, statusUpdate(&driver, TaskStateEq(TASK_RUNNING))) .WillOnce(FutureArg<1>(&status)); ``` Then you can combine both task state and task id matchers to get an exact status update. - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/62837/#review189800 ----------------------------------------------------------- On Oct. 31, 2017, 4:53 a.m., Qian Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/62837/ > ----------------------------------------------------------- > > (Updated Oct. 31, 2017, 4:53 a.m.) > > > Review request for mesos and Vinod Kone. > > > Bugs: MESOS-8051 > https://issues.apache.org/jira/browse/MESOS-8051 > > > Repository: mesos > > > Description > ------- > > Added a test `DefaultExecutorTest.KillMultipleTasks`. > > > Diffs > ----- > > src/tests/default_executor_tests.cpp 5078bd4d70698f5cbd14c971fcecfd58f8467a04 > > > Diff: https://reviews.apache.org/r/62837/diff/2/ > > > Testing > ------- > > [ RUN ] MesosContainerizer/DefaultExecutorTest.KillMultipleTasks/0 > I1030 21:47:58.181413 22360 executor.cpp:192] Version: 1.5.0 > I1030 21:47:58.201525 22382 default_executor.cpp:191] Received SUBSCRIBED event > I1030 21:47:58.203812 22382 default_executor.cpp:195] Subscribed executor on core-dev > I1030 21:47:58.204406 22382 default_executor.cpp:191] Received LAUNCH_GROUP event > I1030 21:47:58.205346 22390 default_executor.cpp:402] Setting 'MESOS_CONTAINER_IP' to: 10.0.49.2 > I1030 21:47:58.220854 22356 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:47:58.221959 22367 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:47:58.261060 22370 default_executor.cpp:640] Successfully launched tasks [ 4fee2fec-12b5-4af6-bd70-e67b4da26c00, 24695aee-aa59-4295-8ad9-19f17ad9d52b ] in child containers [ 94d8e76a-2215-41f9-8a27-c7ff12e96418.a14cf886-fccd-431e-be3b-432a59f85f18, 94d8e76a-2215-41f9-8a27-c7ff12e96418.2fd5de24-fbed-490b-9914-de45902a8b47 ] > I1030 21:47:58.263293 22385 default_executor.cpp:713] Waiting for child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.a14cf886-fccd-431e-be3b-432a59f85f18 of task '4fee2fec-12b5-4af6-bd70-e67b4da26c00' > I1030 21:47:58.263546 22385 default_executor.cpp:713] Waiting for child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.2fd5de24-fbed-490b-9914-de45902a8b47 of task '24695aee-aa59-4295-8ad9-19f17ad9d52b' > I1030 21:47:58.307412 22351 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:47:58.307924 22358 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:47:58.354656 22365 default_executor.cpp:191] Received KILL event > I1030 21:47:58.354730 22365 default_executor.cpp:1172] Received kill for task '4fee2fec-12b5-4af6-bd70-e67b4da26c00' > I1030 21:47:58.354787 22365 default_executor.cpp:1057] Killing task 4fee2fec-12b5-4af6-bd70-e67b4da26c00 running in child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.a14cf886-fccd-431e-be3b-432a59f85f18 with SIGTERM signal > I1030 21:47:58.354825 22365 default_executor.cpp:1079] Scheduling escalation to SIGKILL in 3secs from now > I1030 21:47:58.355772 22365 default_executor.cpp:191] Received KILL event > I1030 21:47:58.355819 22365 default_executor.cpp:1172] Received kill for task '24695aee-aa59-4295-8ad9-19f17ad9d52b' > I1030 21:47:58.355947 22365 default_executor.cpp:1057] Killing task 24695aee-aa59-4295-8ad9-19f17ad9d52b running in child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.2fd5de24-fbed-490b-9914-de45902a8b47 with SIGTERM signal > I1030 21:47:58.355980 22365 default_executor.cpp:1079] Scheduling escalation to SIGKILL in 3secs from now > I1030 21:47:58.467401 22380 default_executor.cpp:888] Child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.a14cf886-fccd-431e-be3b-432a59f85f18 of task '4fee2fec-12b5-4af6-bd70-e67b4da26c00' completed in state TASK_KILLED: Command terminated with signal Terminated > I1030 21:47:58.467478 22380 default_executor.cpp:924] Killing task group containing tasks [ 4fee2fec-12b5-4af6-bd70-e67b4da26c00, 24695aee-aa59-4295-8ad9-19f17ad9d52b ] > I1030 21:47:58.467888 22380 default_executor.cpp:888] Child container 94d8e76a-2215-41f9-8a27-c7ff12e96418.2fd5de24-fbed-490b-9914-de45902a8b47 of task '24695aee-aa59-4295-8ad9-19f17ad9d52b' completed in state TASK_KILLED: Command terminated with signal Terminated > I1030 21:47:58.467934 22380 default_executor.cpp:1017] Terminating after 1secs > [ OK ] MesosContainerizer/DefaultExecutorTest.KillMultipleTasks/0 (922 ms) > > > [ RUN ] ROOT_DOCKER_DockerAndMesosContainerizers/DefaultExecutorTest.KillMultipleTasks/0 > I1030 21:51:07.645311 25065 executor.cpp:192] Version: 1.5.0 > I1030 21:51:07.665602 25086 default_executor.cpp:191] Received SUBSCRIBED event > I1030 21:51:07.667804 25086 default_executor.cpp:195] Subscribed executor on core-dev > I1030 21:51:07.668308 25086 default_executor.cpp:191] Received LAUNCH_GROUP event > I1030 21:51:07.669232 25093 default_executor.cpp:402] Setting 'MESOS_CONTAINER_IP' to: 10.0.49.2 > I1030 21:51:07.684146 25060 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:51:07.685752 25071 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:51:07.730559 25077 default_executor.cpp:640] Successfully launched tasks [ fce3ed1c-d93a-4b6f-8950-771a989b279b, 2e1b7db2-5f05-4474-bd5e-00c03468db71 ] in child containers [ 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.6ee13669-0de9-41b6-bde9-9f581b3e9c2e, 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.d11330e3-4f3a-4686-be5f-935ec8f44111 ] > I1030 21:51:07.732921 25089 default_executor.cpp:713] Waiting for child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.6ee13669-0de9-41b6-bde9-9f581b3e9c2e of task 'fce3ed1c-d93a-4b6f-8950-771a989b279b' > I1030 21:51:07.733170 25089 default_executor.cpp:713] Waiting for child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.d11330e3-4f3a-4686-be5f-935ec8f44111 of task '2e1b7db2-5f05-4474-bd5e-00c03468db71' > I1030 21:51:07.776757 25056 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:51:07.777101 25062 default_executor.cpp:191] Received ACKNOWLEDGED event > I1030 21:51:07.824290 25065 default_executor.cpp:191] Received KILL event > I1030 21:51:07.824533 25065 default_executor.cpp:1172] Received kill for task 'fce3ed1c-d93a-4b6f-8950-771a989b279b' > I1030 21:51:07.824579 25065 default_executor.cpp:1057] Killing task fce3ed1c-d93a-4b6f-8950-771a989b279b running in child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.6ee13669-0de9-41b6-bde9-9f581b3e9c2e with SIGTERM signal > I1030 21:51:07.824606 25065 default_executor.cpp:1079] Scheduling escalation to SIGKILL in 3secs from now > I1030 21:51:07.825533 25065 default_executor.cpp:191] Received KILL event > I1030 21:51:07.825597 25065 default_executor.cpp:1172] Received kill for task '2e1b7db2-5f05-4474-bd5e-00c03468db71' > I1030 21:51:07.825647 25065 default_executor.cpp:1057] Killing task 2e1b7db2-5f05-4474-bd5e-00c03468db71 running in child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.d11330e3-4f3a-4686-be5f-935ec8f44111 with SIGTERM signal > I1030 21:51:07.825690 25065 default_executor.cpp:1079] Scheduling escalation to SIGKILL in 3secs from now > I1030 21:51:07.957986 25083 default_executor.cpp:888] Child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.6ee13669-0de9-41b6-bde9-9f581b3e9c2e of task 'fce3ed1c-d93a-4b6f-8950-771a989b279b' completed in state TASK_KILLED: Command terminated with signal Terminated > I1030 21:51:07.958062 25083 default_executor.cpp:924] Killing task group containing tasks [ fce3ed1c-d93a-4b6f-8950-771a989b279b, 2e1b7db2-5f05-4474-bd5e-00c03468db71 ] > I1030 21:51:07.958566 25083 default_executor.cpp:888] Child container 9b58977b-8d1b-4a3d-a5af-624e44ba12f0.d11330e3-4f3a-4686-be5f-935ec8f44111 of task '2e1b7db2-5f05-4474-bd5e-00c03468db71' completed in state TASK_KILLED: Command terminated with signal Terminated > I1030 21:51:07.958626 25083 default_executor.cpp:1017] Terminating after 1secs > [ OK ] ROOT_DOCKER_DockerAndMesosContainerizers/DefaultExecutorTest.KillMultipleTasks/0 (9200 ms) > > > Thanks, > > Qian Zhang > > --===============2244212622087326697==--