[{"id":28557,"web_url":"https://patchwork.libcamera.org/comment/28557/","msgid":"<87bk9d6s23.fsf@redhat.com>","date":"2024-01-22T20:17:56","subject":"Re: [PATCH 09/12] test: timer-thread: Move timer start from wrong\n\tthread to separate test","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> Starting a timer from the wrong thread is expected to fail, and we test\n> this in the timer-thread unit test. This is however not something that a\n> caller is allowed to do, and libcamera will get assertion failures to\n> catch this invalid usage. The unit test will then fail.\n>\n> To prepare for this, split the unit test in two, with a test that is\n> expected by meson to succeed, and one that is expected to fail. The\n> assertion will then cause an expected failure, making the test suite\n> succeed.\n\nWhat if the tests crashes for an unrelated reason?  Is it possible to\ndistinguish between the \"right\" error and an unexpected error?\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  test/meson.build      |   9 ++--\n>  test/timer-fail.cpp   | 101 ++++++++++++++++++++++++++++++++++++++++++\n>  test/timer-thread.cpp |  22 ---------\n>  3 files changed, 107 insertions(+), 25 deletions(-)\n>  create mode 100644 test/timer-fail.cpp\n>\n> diff --git a/test/meson.build b/test/meson.build\n> index 189e1428485a..8b6057d4e800 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -69,6 +69,7 @@ internal_tests = [\n>      {'name': 'signal-threads', 'sources': ['signal-threads.cpp']},\n>      {'name': 'threads', 'sources': 'threads.cpp', 'dependencies': [libthreads]},\n>      {'name': 'timer', 'sources': ['timer.cpp']},\n> +    {'name': 'timer-fail', 'sources': ['timer-fail.cpp'], 'should_fail': true},\n>      {'name': 'timer-thread', 'sources': ['timer-thread.cpp']},\n>      {'name': 'unique-fd', 'sources': ['unique-fd.cpp']},\n>      {'name': 'utils', 'sources': ['utils.cpp']},\n> @@ -91,7 +92,7 @@ foreach test : public_tests\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>  \n> -    test(test['name'], exe)\n> +    test(test['name'], exe, should_fail : test.get('should_fail', false))\n>  endforeach\n>  \n>  foreach test : internal_tests\n> @@ -105,7 +106,7 @@ foreach test : internal_tests\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>  \n> -    test(test['name'], exe)\n> +    test(test['name'], exe, should_fail : test.get('should_fail', false))\n>  endforeach\n>  \n>  foreach test : internal_non_parallel_tests\n> @@ -119,5 +120,7 @@ foreach test : internal_non_parallel_tests\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>  \n> -    test(test['name'], exe, is_parallel : false)\n> +    test(test['name'], exe,\n> +         is_parallel : false,\n> +         should_fail : test.get('should_fail', false))\n>  endforeach\n> diff --git a/test/timer-fail.cpp b/test/timer-fail.cpp\n> new file mode 100644\n> index 000000000000..e9a3b1b61bcb\n> --- /dev/null\n> +++ b/test/timer-fail.cpp\n> @@ -0,0 +1,101 @@\n> +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> +/*\n> + * Copyright (C) 2024, Ideas on Board Oy\n> + *\n> + * timer-fail.cpp - Threaded timer failure test\n> + */\n> +\n> +#include <chrono>\n> +#include <iostream>\n> +\n> +#include <libcamera/base/event_dispatcher.h>\n> +#include <libcamera/base/object.h>\n> +#include <libcamera/base/thread.h>\n> +#include <libcamera/base/timer.h>\n> +\n> +#include \"test.h\"\n> +\n> +using namespace libcamera;\n> +using namespace std;\n> +using namespace std::chrono_literals;\n> +\n> +class TimeoutHandler : public Object\n> +{\n> +public:\n> +\tTimeoutHandler()\n> +\t\t: timer_(this), timeout_(false)\n> +\t{\n> +\t\ttimer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);\n> +\t}\n> +\n> +\tvoid start()\n> +\t{\n> +\t\ttimer_.start(100ms);\n> +\t}\n> +\n> +\tbool timeout() const\n> +\t{\n> +\t\treturn timeout_;\n> +\t}\n> +\n> +private:\n> +\tvoid timeoutHandler()\n> +\t{\n> +\t\ttimeout_ = true;\n> +\t}\n> +\n> +\tTimer timer_;\n> +\tbool timeout_;\n> +};\n> +\n> +class TimerFailTest : public Test\n> +{\n> +protected:\n> +\tint init()\n> +\t{\n> +\t\tthread_.start();\n> +\t\ttimeout_.moveToThread(&thread_);\n> +\n> +\t\treturn TestPass;\n> +\t}\n> +\n> +\tint run()\n> +\t{\n> +\t\t/*\n> +\t\t * Test that the forbidden operation of starting the timer from\n> +\t\t * another thread results in a failure. We need to interrupt the\n> +\t\t * event dispatcher to make sure we don't succeed simply because\n> +\t\t * the event dispatcher hasn't noticed the timer restart.\n> +\t\t */\n> +\t\ttimeout_.start();\n> +\t\tthread_.eventDispatcher()->interrupt();\n> +\n> +\t\tthis_thread::sleep_for(chrono::milliseconds(200));\n> +\n> +\t\t/*\n> +\t\t * Meson expects this test to fail, so we need to return\n\nIt'd be good to mention here that it's expected to fail on an assertion.\n\n> +\t\t * TestPass in the unexpected (usually known as \"fail\"), case,\n> +\t\t * and TestFail otherwise.\n> +\t\t */\n> +\t\tif (timeout_.timeout()) {\n> +\t\t\tcout << \"Timer start from wrong thread succeeded unexpectedly\"\n> +\t\t\t     << endl;\n> +\t\t\treturn TestPass;\n> +\t\t}\n> +\n> +\t\treturn TestFail;\n> +\t}\n> +\n> +\tvoid cleanup()\n> +\t{\n> +\t\t/* Must stop thread before destroying timeout. */\n> +\t\tthread_.exit(0);\n> +\t\tthread_.wait();\n> +\t}\n> +\n> +private:\n> +\tTimeoutHandler timeout_;\n> +\tThread thread_;\n> +};\n> +\n> +TEST_REGISTER(TimerFailTest)\n> diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp\n> index 0bcd0d8ce194..4caf4e33b2ba 100644\n> --- a/test/timer-thread.cpp\n> +++ b/test/timer-thread.cpp\n> @@ -29,12 +29,6 @@ public:\n>  \t\ttimer_.start(100ms);\n>  \t}\n>  \n> -\tvoid restart()\n> -\t{\n> -\t\ttimeout_ = false;\n> -\t\ttimer_.start(100ms);\n> -\t}\n> -\n>  \tbool timeout() const\n>  \t{\n>  \t\treturn timeout_;\n> @@ -74,22 +68,6 @@ protected:\n>  \t\t\treturn TestFail;\n>  \t\t}\n>  \n> -\t\t/*\n> -\t\t * Test that starting the timer from another thread fails. We\n> -\t\t * need to interrupt the event dispatcher to make sure we don't\n> -\t\t * succeed simply because the event dispatcher hasn't noticed\n> -\t\t * the timer restart.\n> -\t\t */\n> -\t\ttimeout_.restart();\n> -\t\tthread_.eventDispatcher()->interrupt();\n> -\n> -\t\tthis_thread::sleep_for(chrono::milliseconds(200));\n> -\n> -\t\tif (timeout_.timeout()) {\n> -\t\t\tcout << \"Timer restart test failed\" << endl;\n> -\t\t\treturn TestFail;\n> -\t\t}\n> -\n>  \t\treturn TestPass;\n>  \t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BC057C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Jan 2024 20:18:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ED71B62936;\n\tMon, 22 Jan 2024 21:18:04 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9974628B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jan 2024 21:18:02 +0100 (CET)","from mail-lf1-f70.google.com (mail-lf1-f70.google.com\n\t[209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-572-36QtMqjOOG2ivkr44Cr0bA-1; Mon, 22 Jan 2024 15:18:00 -0500","by mail-lf1-f70.google.com with SMTP id\n\t2adb3069b0e04-50e7b7c85easo2449124e87.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jan 2024 12:18:00 -0800 (PST)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\ty23-20020a170906559700b00a269357c2e7sm13640118ejp.36.2024.01.22.12.17.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 22 Jan 2024 12:17:57 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Tdr9geN3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1705954681;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=tuC9mibvq6sjD5Fc8cHNVTeRzxLjKkIeUPkOQg+CjYo=;\n\tb=Tdr9geN3eIGmTyG3iZo/008H06jkZ/ZcIAQUhJeDCP1IA9HLQC3Vo7ufH56azrYmNCQUBu\n\tpE5DFQ5PkJAO5C4M1tlWu+qeAN3d5aYhFZnlN1xGcF+MNzITba86qbhN12BEJsZdERYLx2\n\tZ5Onbkx545iTTwQO7p/TVKEk7eJbrpo=","X-MC-Unique":"36QtMqjOOG2ivkr44Cr0bA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1705954678; x=1706559478;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=tuC9mibvq6sjD5Fc8cHNVTeRzxLjKkIeUPkOQg+CjYo=;\n\tb=LlAHbc4PnIkkA2eVgqnifGHCbilajg/bNenjzwS5/O0svq8+HK57Qt3TdTQzHAxc2k\n\td/lR+44KavurYFAaZIHkBRh67FhqetI7qZ4Xn/7yjZuGVyZ/PoWI78Wd4Z/pJhjaBrLh\n\tYUQ5j2tKMKuO4Gh0jWsesXQ9xQ/dc+mlBnXehYjxUAnCi8GlYIzNuMUMWEYyAvP0BLl3\n\tkaLpObpnMAdr/DV5RKg7wHsBUIJ5Z2J7oVxcsCBJ/hx9UCz+l7idJHNTzmUh0RA0+/da\n\tRqbcmRgPJPm3sbB+e8tp70oRIuhFvVspbkHEsLcxCLgJuJwJORomnr2w8YHAe51jJPjb\n\tWYPg==","X-Gm-Message-State":"AOJu0YwiwiJZLEHiXtixakdj2QQrxr0q21BZ3PqEs3iU9MzaNXvcf6kx\n\tbKIrAThiwj1eyAlZorQAkVko5xX8jLVg83H4YBUjYVRb/1aOlLryZze2W2ZtE99wv8P6Bx9zVXO\n\t3yw1VsZlxs9FaNjY6YYmu85jdcW+mqFWMZ78yCC5KcA8QFGjun4PjjOVg+79xHIrPCXQT8ysEZO\n\tOecQxedSjWFFg6+Al79hE3lh0xOwoYjce2rmYBpH87+rjOXNyYmkYP3M4=","X-Received":["by 2002:a05:6512:1107:b0:50d:1e16:59b7 with SMTP id\n\tl7-20020a056512110700b0050d1e1659b7mr531965lfg.106.1705954678545; \n\tMon, 22 Jan 2024 12:17:58 -0800 (PST)","by 2002:a05:6512:1107:b0:50d:1e16:59b7 with SMTP id\n\tl7-20020a056512110700b0050d1e1659b7mr531958lfg.106.1705954678117; \n\tMon, 22 Jan 2024 12:17:58 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHjtGU3y94WwZRK7ZkZYYLipHgLx0dc4bC7geRMo8COJzSt7rF4PxwL5p2Dt3pbRnHUjOH81A==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 09/12] test: timer-thread: Move timer start from wrong\n\tthread to separate test","In-Reply-To":"<20240121035948.4226-10-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Sun, 21 Jan 2024 05:59:45 +0200\")","References":"<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>\n\t<20240121035948.4226-10-laurent.pinchart@ideasonboard.com>","Date":"Mon, 22 Jan 2024 21:17:56 +0100","Message-ID":"<87bk9d6s23.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28566,"web_url":"https://patchwork.libcamera.org/comment/28566/","msgid":"<20240122234352.GA10843@pendragon.ideasonboard.com>","date":"2024-01-22T23:43:52","subject":"Re: [PATCH 09/12] test: timer-thread: Move timer start from wrong\n\tthread to separate test","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Jan 22, 2024 at 09:17:56PM +0100, Milan Zamazal wrote:\n> Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n> \n> > Starting a timer from the wrong thread is expected to fail, and we test\n> > this in the timer-thread unit test. This is however not something that a\n> > caller is allowed to do, and libcamera will get assertion failures to\n> > catch this invalid usage. The unit test will then fail.\n> >\n> > To prepare for this, split the unit test in two, with a test that is\n> > expected by meson to succeed, and one that is expected to fail. The\n> > assertion will then cause an expected failure, making the test suite\n> > succeed.\n> \n> What if the tests crashes for an unrelated reason?  Is it possible to\n> distinguish between the \"right\" error and an unexpected error?\n\nNot easily, meson won't distinguish between different assertion errors.\nI'm pretty sure we could create some kind of wrapper that would parse\nthe logs, but I don't think that's in scope for this series.\n\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  test/meson.build      |   9 ++--\n> >  test/timer-fail.cpp   | 101 ++++++++++++++++++++++++++++++++++++++++++\n> >  test/timer-thread.cpp |  22 ---------\n> >  3 files changed, 107 insertions(+), 25 deletions(-)\n> >  create mode 100644 test/timer-fail.cpp\n> >\n> > diff --git a/test/meson.build b/test/meson.build\n> > index 189e1428485a..8b6057d4e800 100644\n> > --- a/test/meson.build\n> > +++ b/test/meson.build\n> > @@ -69,6 +69,7 @@ internal_tests = [\n> >      {'name': 'signal-threads', 'sources': ['signal-threads.cpp']},\n> >      {'name': 'threads', 'sources': 'threads.cpp', 'dependencies': [libthreads]},\n> >      {'name': 'timer', 'sources': ['timer.cpp']},\n> > +    {'name': 'timer-fail', 'sources': ['timer-fail.cpp'], 'should_fail': true},\n> >      {'name': 'timer-thread', 'sources': ['timer-thread.cpp']},\n> >      {'name': 'unique-fd', 'sources': ['unique-fd.cpp']},\n> >      {'name': 'utils', 'sources': ['utils.cpp']},\n> > @@ -91,7 +92,7 @@ foreach test : public_tests\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_public)\n> >  \n> > -    test(test['name'], exe)\n> > +    test(test['name'], exe, should_fail : test.get('should_fail', false))\n> >  endforeach\n> >  \n> >  foreach test : internal_tests\n> > @@ -105,7 +106,7 @@ foreach test : internal_tests\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >  \n> > -    test(test['name'], exe)\n> > +    test(test['name'], exe, should_fail : test.get('should_fail', false))\n> >  endforeach\n> >  \n> >  foreach test : internal_non_parallel_tests\n> > @@ -119,5 +120,7 @@ foreach test : internal_non_parallel_tests\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >  \n> > -    test(test['name'], exe, is_parallel : false)\n> > +    test(test['name'], exe,\n> > +         is_parallel : false,\n> > +         should_fail : test.get('should_fail', false))\n> >  endforeach\n> > diff --git a/test/timer-fail.cpp b/test/timer-fail.cpp\n> > new file mode 100644\n> > index 000000000000..e9a3b1b61bcb\n> > --- /dev/null\n> > +++ b/test/timer-fail.cpp\n> > @@ -0,0 +1,101 @@\n> > +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> > +/*\n> > + * Copyright (C) 2024, Ideas on Board Oy\n> > + *\n> > + * timer-fail.cpp - Threaded timer failure test\n> > + */\n> > +\n> > +#include <chrono>\n> > +#include <iostream>\n> > +\n> > +#include <libcamera/base/event_dispatcher.h>\n> > +#include <libcamera/base/object.h>\n> > +#include <libcamera/base/thread.h>\n> > +#include <libcamera/base/timer.h>\n> > +\n> > +#include \"test.h\"\n> > +\n> > +using namespace libcamera;\n> > +using namespace std;\n> > +using namespace std::chrono_literals;\n> > +\n> > +class TimeoutHandler : public Object\n> > +{\n> > +public:\n> > +\tTimeoutHandler()\n> > +\t\t: timer_(this), timeout_(false)\n> > +\t{\n> > +\t\ttimer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);\n> > +\t}\n> > +\n> > +\tvoid start()\n> > +\t{\n> > +\t\ttimer_.start(100ms);\n> > +\t}\n> > +\n> > +\tbool timeout() const\n> > +\t{\n> > +\t\treturn timeout_;\n> > +\t}\n> > +\n> > +private:\n> > +\tvoid timeoutHandler()\n> > +\t{\n> > +\t\ttimeout_ = true;\n> > +\t}\n> > +\n> > +\tTimer timer_;\n> > +\tbool timeout_;\n> > +};\n> > +\n> > +class TimerFailTest : public Test\n> > +{\n> > +protected:\n> > +\tint init()\n> > +\t{\n> > +\t\tthread_.start();\n> > +\t\ttimeout_.moveToThread(&thread_);\n> > +\n> > +\t\treturn TestPass;\n> > +\t}\n> > +\n> > +\tint run()\n> > +\t{\n> > +\t\t/*\n> > +\t\t * Test that the forbidden operation of starting the timer from\n> > +\t\t * another thread results in a failure. We need to interrupt the\n> > +\t\t * event dispatcher to make sure we don't succeed simply because\n> > +\t\t * the event dispatcher hasn't noticed the timer restart.\n> > +\t\t */\n> > +\t\ttimeout_.start();\n> > +\t\tthread_.eventDispatcher()->interrupt();\n> > +\n> > +\t\tthis_thread::sleep_for(chrono::milliseconds(200));\n> > +\n> > +\t\t/*\n> > +\t\t * Meson expects this test to fail, so we need to return\n> \n> It'd be good to mention here that it's expected to fail on an assertion.\n\nI'll expand the comment to\n\n\t\t * The wrong start() call should result in an assertion in debug\n\t\t * builds, and a timeout in release builds. The test is\n\t\t * therefore marked in meson.build as expected to fail. We need\n\t\t * to return TestPass in the unexpected (usually known as\n\t\t * \"fail\") case, and TestFail otherwise.\n\n> > +\t\t * TestPass in the unexpected (usually known as \"fail\"), case,\n> > +\t\t * and TestFail otherwise.\n> > +\t\t */\n> > +\t\tif (timeout_.timeout()) {\n> > +\t\t\tcout << \"Timer start from wrong thread succeeded unexpectedly\"\n> > +\t\t\t     << endl;\n> > +\t\t\treturn TestPass;\n> > +\t\t}\n> > +\n> > +\t\treturn TestFail;\n> > +\t}\n> > +\n> > +\tvoid cleanup()\n> > +\t{\n> > +\t\t/* Must stop thread before destroying timeout. */\n> > +\t\tthread_.exit(0);\n> > +\t\tthread_.wait();\n> > +\t}\n> > +\n> > +private:\n> > +\tTimeoutHandler timeout_;\n> > +\tThread thread_;\n> > +};\n> > +\n> > +TEST_REGISTER(TimerFailTest)\n> > diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp\n> > index 0bcd0d8ce194..4caf4e33b2ba 100644\n> > --- a/test/timer-thread.cpp\n> > +++ b/test/timer-thread.cpp\n> > @@ -29,12 +29,6 @@ public:\n> >  \t\ttimer_.start(100ms);\n> >  \t}\n> >  \n> > -\tvoid restart()\n> > -\t{\n> > -\t\ttimeout_ = false;\n> > -\t\ttimer_.start(100ms);\n> > -\t}\n> > -\n> >  \tbool timeout() const\n> >  \t{\n> >  \t\treturn timeout_;\n> > @@ -74,22 +68,6 @@ protected:\n> >  \t\t\treturn TestFail;\n> >  \t\t}\n> >  \n> > -\t\t/*\n> > -\t\t * Test that starting the timer from another thread fails. We\n> > -\t\t * need to interrupt the event dispatcher to make sure we don't\n> > -\t\t * succeed simply because the event dispatcher hasn't noticed\n> > -\t\t * the timer restart.\n> > -\t\t */\n> > -\t\ttimeout_.restart();\n> > -\t\tthread_.eventDispatcher()->interrupt();\n> > -\n> > -\t\tthis_thread::sleep_for(chrono::milliseconds(200));\n> > -\n> > -\t\tif (timeout_.timeout()) {\n> > -\t\t\tcout << \"Timer restart test failed\" << endl;\n> > -\t\t\treturn TestFail;\n> > -\t\t}\n> > -\n> >  \t\treturn TestPass;\n> >  \t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 88932C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Jan 2024 23:43:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E06BE628B7;\n\tTue, 23 Jan 2024 00:43:50 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F100628B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jan 2024 00:43:49 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D9ECF541;\n\tTue, 23 Jan 2024 00:42:35 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"T3E2rHEG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705966956;\n\tbh=XXNPedPxknbYhJbQi7UGZ2QH/vp5QEUn1F8r0GXz8O8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=T3E2rHEGh3ZWyIKCr/QM3J/qaW8uX2hwC0iCHc2idnqyiXhteex1BWOU0rGK9nBUs\n\tPor1AckMkdTIWpc/6jL+ugyW3n8rAn4kiw2qBWnMxJwBdez4wm8Vfe9rxvGMjPUKEo\n\tmgkXkqHXZ2NikdrfYi6lP+w3+eSg7vlXLSUgeT4s=","Date":"Tue, 23 Jan 2024 01:43:52 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Subject":"Re: [PATCH 09/12] test: timer-thread: Move timer start from wrong\n\tthread to separate test","Message-ID":"<20240122234352.GA10843@pendragon.ideasonboard.com>","References":"<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>\n\t<20240121035948.4226-10-laurent.pinchart@ideasonboard.com>\n\t<87bk9d6s23.fsf@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<87bk9d6s23.fsf@redhat.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]