{"id":1955,"url":"https://patchwork.libcamera.org/api/patches/1955/?format=json","web_url":"https://patchwork.libcamera.org/patch/1955/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190910090418.30502-2-kieran.bingham@ideasonboard.com>","date":"2019-09-10T09:04:16","name":"[libcamera-devel,1/3] test: process: Fix forking race","commit_ref":"ee35abb7c7e0ba26d6453fb5e1c3b79e596c9fd0","pull_url":null,"state":"accepted","archived":false,"hash":"f70847754246dfa92a70f35b302cd2ebbd7ff5a1","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1955/mbox/","series":[{"id":485,"url":"https://patchwork.libcamera.org/api/series/485/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=485","date":"2019-09-10T09:04:15","name":"test: process: Cleanup to process test","version":1,"mbox":"https://patchwork.libcamera.org/series/485/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1955/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1955/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C8D560BCF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Sep 2019 11:04:26 +0200 (CEST)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8CBEB54A;\n\tTue, 10 Sep 2019 11:04:25 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1568106265;\n\tbh=2x7rlLvn5jUG9FQq4tmlXuHgNXRG2mXOyVonii+cnu4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jHCzExoUMR+DBHv1UoHTq8U2Fy4iyAkSxo+VDhKqGXPJ5xN/krJEq1DOrm2PvRT+3\n\tiaYLH5fc3tkGIrAAO1qp5RghPJxYsmJEk3Nw+hYPxG394/X7tztWHN3qtfq3h7+Sq0\n\td8Tefi+DBhS11hDZCxdYaQWHH2BhsFGlhTPq3AAE=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 10 Sep 2019 10:04:16 +0100","Message-Id":"<20190910090418.30502-2-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190910090418.30502-1-kieran.bingham@ideasonboard.com>","References":"<20190910090418.30502-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/3] test: process: Fix forking race","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 10 Sep 2019 09:04:26 -0000"},"content":"The procFinished event handler is registered after the process is\nstarted, leading to the opportunity of a missed race.\n\nRegister the handler before the process is launched.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/process/process_test.cpp | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)","diff":"diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp\nindex d264555e545f..701f156b5053 100644\n--- a/test/process/process_test.cpp\n+++ b/test/process/process_test.cpp\n@@ -47,12 +47,13 @@ protected:\n \t\tint exitCode = 42;\n \t\tvector<std::string> args;\n \t\targs.push_back(to_string(exitCode));\n+\t\tproc_.finished.connect(this, &ProcessTest::procFinished);\n+\n \t\tint ret = proc_.start(\"/proc/self/exe\", args);\n \t\tif (ret) {\n \t\t\tcerr << \"failed to start process\" << endl;\n \t\t\treturn TestFail;\n \t\t}\n-\t\tproc_.finished.connect(this, &ProcessTest::procFinished);\n \n \t\ttimeout.start(100);\n \t\twhile (timeout.isRunning())\n","prefixes":["libcamera-devel","1/3"]}