[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core][PATCH v4] libevent: mark util/monotonic_prc_fallback as retriable
From:       "Alexander Kanavin" <alex.kanavin () gmail ! com>
Date:       2021-09-30 14:29:49
Message-ID: CANNYZj_99ChPmn+ogGwQ4xrmDog9DCfEh1HXBgLpGzLZeY7uPQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Neither the syntax was fixed, nor the other patch was submitted upstream.

Alex

On Thu, 30 Sept 2021 at 16:21, Thomas Perrot <thomas.perrot@bootlin.com>
wrote:

> Hello,
>
> On Thu, 2021-09-30 at 16:11 +0200, Alexander Kanavin wrote:
> > How is this different to the previous patch submission?
> >
>
> I have indicated where patch 0003 comes from in the upstream status.
>
> Was there any other change to make?
>
> Best regards,
> Thomas
>
> > Alex
> >
> > On Thu, 30 Sept 2021 at 16:08, Thomas Perrot <
> > thomas.perrot@bootlin.com> wrote:
> > > Backport a patch to fix the below ptest failure:
> > >  # ./run-ptest
> > >  Running tests:
> > >  EVPORT
> > >  Skipping test
> > >  KQUEUE
> > >  Skipping test
> > >  EPOLL
> > >  test-eof: OKAY
> > >  test-dumpevents: OKAY (output not checked)
> > >  regress:
> > >   FAIL ../libevent-2.1.12-stable/test/regress_util.c:1478:
> > > assert(diff.tv_sec == 0): 1 vs 0 util/monotonic_prc_fallback:
> > >   [monotonic_prc_fallback FAILED]
> > >  1/312 TESTS FAILED. (33 skipped)
> > >  FAILED
> > >  regress_debug:
> > >   FAIL ../libevent-2.1.12-stable/test/regress_util.c:1478:
> > > assert(diff.tv_sec == 0): 1 vs 0 util/monotonic_prc_fallback:
> > >   [monotonic_prc_fallback FAILED]
> > >  1/312 TESTS FAILED. (33 skipped)
> > >  FAILED
> > >  [snip]
> > >
> > > (From OE-Core rev: edecbbdacab5227c75e4a199e124389f8036b421)
> > >
> > > [YOCTO #14507]
> > >
> > > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
> > > ---
> > >  ...-monotonic_prc_fallback-as-retriable.patch | 28 +++++++
> > >  ...ts-are-marked-failed-only-when-all-a.patch | 81
> > > +++++++++++++++++++
> > >  .../libevent/libevent/run-ptest               | 10 +--
> > >  .../libevent/libevent_2.1.12.bb               |  4 +-
> > >  4 files changed, 117 insertions(+), 6 deletions(-)
> > >  create mode 100644 meta/recipes-support/libevent/libevent/0003-test-
> > > mark-util-monotonic_prc_fallback-as-retriable.patch
> > >  create mode 100644 meta/recipes-support/libevent/libevent/0004-test-
> > > retriable-tests-are-marked-failed-only-when-all-a.patch
> > >
> > > diff --git a/meta/recipes-support/libevent/libevent/0003-test-mark-
> > > util-monotonic_prc_fallback-as-retriable.patch b/meta/recipes-
> > > support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-
> > > as-retriable.patch
> > > new file mode 100644
> > > index 000000000000..ea322511d7e9
> > > --- /dev/null
> > > +++ b/meta/recipes-support/libevent/libevent/0003-test-mark-util-
> > > monotonic_prc_fallback-as-retriable.patch
> > > @@ -0,0 +1,28 @@
> > > +From 5a9a5faf27d85c89b40fb610cd23a4b62a7dbf0e Mon Sep 17 00:00:00
> > > 2001
> > > +From: Azat Khuzhin <azat@libevent.org>
> > > +Date: Sun, 19 Sep 2021 00:57:31 +0300
> > > +Subject: [PATCH] test: mark util/monotonic_prc_fallback as retriable
> > > +
> > > +Refs: #1193
> > > +
> > > +Upstream-status: Backported
> > > [
> > >
> https://github.com/libevent/libevent/commit/04fcd7c6df158bb65261867de4b9ec8439696934
> > > ]
> > > +---
> > > + test/regress_util.c | 2 +-
> > > + 1 file changed, 1 insertion(+), 1 deletion(-)
> > > +
> > > +diff --git a/test/regress_util.c b/test/regress_util.c
> > > +index 45caa2700a40..a9e80db20149 100644
> > > +--- a/test/regress_util.c
> > > ++++ b/test/regress_util.c
> > > +@@ -1672,7 +1672,7 @@ struct testcase_t util_testcases[] = {
> > > +       { "monotonic_res_fallback", test_evutil_monotonic_res,
> > > TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" },
> > > +       { "monotonic_prc", test_evutil_monotonic_prc, 0,
> > > &basic_setup, (void*)"" },
> > > +       { "monotonic_prc_precise", test_evutil_monotonic_prc,
> > > TT_RETRIABLE, &basic_setup, (void*)"precise" },
> > > +-      { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0,
> > > &basic_setup, (void*)"fallback" },
> > > ++      { "monotonic_prc_fallback", test_evutil_monotonic_prc,
> > > TT_RETRIABLE, &basic_setup, (void*)"fallback" },
> > > +       { "date_rfc1123", test_evutil_date_rfc1123, 0, NULL, NULL },
> > > +       { "evutil_v4addr_is_local", test_evutil_v4addr_is_local, 0,
> > > NULL, NULL },
> > > +       { "evutil_v6addr_is_local", test_evutil_v6addr_is_local, 0,
> > > NULL, NULL },
> > > +--
> > > +2.31.1
> > > +
> > > diff --git a/meta/recipes-support/libevent/libevent/0004-test-
> > > retriable-tests-are-marked-failed-only-when-all-a.patch
> > > b/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-
> > > are-marked-failed-only-when-all-a.patch
> > > new file mode 100644
> > > index 000000000000..ae7db0b7aa85
> > > --- /dev/null
> > > +++ b/meta/recipes-support/libevent/libevent/0004-test-retriable-
> > > tests-are-marked-failed-only-when-all-a.patch
> > > @@ -0,0 +1,81 @@
> > > +From 36ebd92fa53c0097f1e2f9ec5aa5b5c6ec1b411d Mon Sep 17 00:00:00
> > > 2001
> > > +From: Thomas Perrot <thomas.perrot@bootlin.com>
> > > +Date: Wed, 29 Sep 2021 13:50:35 +0200
> > > +Subject: [PATCH] test: retriable tests are marked failed only when
> > > all
> > > + attempts have failed
> > > +
> > > +Fixes: #1193
> > > +
> > > +Upstream-status: Pending
> > > +
> > > +Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
> > > +---
> > > + test/tinytest.c | 13 ++++++-------
> > > + test/tinytest.h |  2 +-
> > > + 2 files changed, 7 insertions(+), 8 deletions(-)
> > > +
> > > +diff --git a/test/tinytest.c b/test/tinytest.c
> > > +index 85dfe74a720e..bf2882418eb6 100644
> > > +--- a/test/tinytest.c
> > > ++++ b/test/tinytest.c
> > > +@@ -310,7 +310,8 @@ testcase_run_forked_(const struct testgroup_t
> > > *group,
> > > +
> > > + int
> > > + testcase_run_one(const struct testgroup_t *group,
> > > +-               const struct testcase_t *testcase)
> > > ++               const struct testcase_t *testcase,
> > > ++               const int test_attempts)
> > > + {
> > > +       enum outcome outcome;
> > > +
> > > +@@ -348,7 +349,7 @@ testcase_run_one(const struct testgroup_t
> > > *group,
> > > +               if (opt_verbosity>0 && !opt_forked)
> > > +                       puts("SKIPPED");
> > > +       } else {
> > > +-              if (!opt_forked)
> > > ++              if (!opt_forked && (testcase->flags & TT_RETRIABLE)
> > > && !test_attempts)
> > > +                       printf("\n  [%s FAILED]\n", testcase->name);
> > > +       }
> > > +
> > > +@@ -525,22 +526,20 @@ tinytest_main(int c, const char **v, struct
> > > testgroup_t *groups)
> > > +               struct testgroup_t *group = &groups[i];
> > > +               for (j = 0; group->cases[j].name; ++j) {
> > > +                       struct testcase_t *testcase = &group-
> > > > cases[j];
> > > +-                      int test_attempts = 3;
> > > ++                      int test_attempts = (testcase->flags &
> > > TT_RETRIABLE) ? 3: 1;
> > > +                       int test_ret_err;
> > > +
> > > +                       if (!(testcase->flags & TT_ENABLED_))
> > > +                               continue;
> > > +
> > > +                       for (;;) {
> > > +-                              test_ret_err =
> > > testcase_run_one(group, testcase);
> > > ++                              test_ret_err =
> > > testcase_run_one(group, testcase, test_attempts);
> > > +
> > > +                               if (test_ret_err == OK)
> > > +                                       break;
> > > +-                              if (!(testcase->flags &
> > > TT_RETRIABLE))
> > > ++                              if (!--test_attempts)
> > > +                                       break;
> > > +                               printf("\n  [RETRYING %s (%i)]\n",
> > > testcase->name, test_attempts);
> > > +-                              if (!test_attempts--)
> > > +-                                      break;
> > > +                       }
> > > +
> > > +                       switch (test_ret_err) {
> > > +diff --git a/test/tinytest.h b/test/tinytest.h
> > > +index d321dd467542..c276b5339331 100644
> > > +--- a/test/tinytest.h
> > > ++++ b/test/tinytest.h
> > > +@@ -92,7 +92,7 @@ char *tinytest_format_hex_(const void *, unsigned
> > > long);
> > > +       tinytest_set_flag_(groups, named, 1, TT_SKIP)
> > > +
> > > + /** Run a single testcase in a single group. */
> > > +-int testcase_run_one(const struct testgroup_t *,const struct
> > > testcase_t *);
> > > ++int testcase_run_one(const struct testgroup_t *,const struct
> > > testcase_t *, const int test_attempts);
> > > +
> > > + void tinytest_set_aliases(const struct testlist_alias_t *aliases);
> > > +
> > > +--
> > > +2.31.1
> > > +
> > > diff --git a/meta/recipes-support/libevent/libevent/run-ptest
> > > b/meta/recipes-support/libevent/libevent/run-ptest
> > > index d3b5e793c3c5..ef4260d1c413 100644
> > > --- a/meta/recipes-support/libevent/libevent/run-ptest
> > > +++ b/meta/recipes-support/libevent/libevent/run-ptest
> > > @@ -1,14 +1,14 @@
> > >  #!/bin/sh
> > >
> > >  # run-ptest - 'ptest' test infrastructure shell script that
> > > -#   wraps the libevent test scripts
> > > +#   wraps the libevent test scripts
> > >  #
> > >  # Trevor Gamblin <trevor.gamblin@windriver.com>
> > >  ###############################################################
> > >  LIBEVENTLIB=@libdir@/libevent
> > >  LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log"
> > >
> > > -cd ${LIBEVENTLIB}/ptest
> > > +cd ${LIBEVENTLIB}/ptest
> > >
> > >  # Run only the libevent "regress" test. All other test scripts in
> > > the
> > >  # libevent "test" folder are related to performance, e.g. read/write
> > > @@ -16,9 +16,9 @@ cd ${LIBEVENTLIB}/ptest
> > >  # in the ptest log.
> > >  ./test/regress 2>&1| sed -e '/TESTS/d' -e '/tests/d' -e '/OK/
> > > s/^/PASS: / ; /FAILED/ s/^/FAIL: / ; /SKIPPED/ s/^/SKIP: / ;
> > > /DISABLED/ s/^/SKIP: /' | cut -f1,2 -d ':' | tee -a ${LOG}
> > >
> > > -passed=`grep PASS ${LOG}|wc -l`
> > > -failed=`grep FAIL ${LOG}|wc -l`
> > > -skipped=`grep -E SKIP ${LOG}|wc -l`
> > > +passed=`grep PASS: ${LOG}|wc -l`
> > > +failed=`grep FAIL: ${LOG}|wc -l`
> > > +skipped=`grep -E SKIP: ${LOG}|wc -l`
> > >  all=$((passed + failed + skipped))
> > >
> > >  (   echo "=== Test Summary ==="
> > > diff --git a/meta/recipes-support/libevent/libevent_2.1.12.bb
> > > b/meta/recipes-support/libevent/libevent_2.1.12.bb
> > > index 4b419eab226d..e26e8a9b5725 100644
> > > --- a/meta/recipes-support/libevent/libevent_2.1.12.bb
> > > +++ b/meta/recipes-support/libevent/libevent_2.1.12.bb
> > > @@ -16,6 +16,8 @@ SRC_URI =
> > > "
> > > https://github.com/libevent/libevent/releases/download/release-${PV}-
> > >             file://run-ptest \
> > >             file://0001-test-regress_dns.c-patch-out-tests-that-
> > > require-a-wo.patch \
> > >             file://0002-test-regress.h-Increase-default-timeval-
> > > tolerance-50.patch \
> > > +           file://0003-test-mark-util-monotonic_prc_fallback-as-
> > > retriable.patch \
> > > +           file://0004-test-retriable-tests-are-marked-failed-only-
> > > when-all-a.patch \
> > >             "
> > >
> > >  SRC_URI[sha256sum] =
> > > "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb"
> > > @@ -56,7 +58,7 @@ do_install_ptest() {
> > >         do
> > >                 install -m 0755 $file ${D}${PTEST_PATH}/test
> > >         done
> > > -
> > > +
> > >          # handle multilib
> > >          sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
> > >  }
>
> --
> Thomas Perrot, Bootlin
> Embedded Linux and kernel engineering
> https://bootlin.com
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>Neither the syntax was fixed, nor the other patch was submitted \
upstream.</div><div><br></div><div>Alex<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Sept 2021 at 16:21, \
Thomas Perrot &lt;<a \
href="mailto:thomas.perrot@bootlin.com">thomas.perrot@bootlin.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br> <br>
On Thu, 2021-09-30 at 16:11 +0200, Alexander Kanavin wrote:<br>
&gt; How is this different to the previous patch submission?<br>
&gt; <br>
<br>
I have indicated where patch 0003 comes from in the upstream status.<br>
<br>
Was there any other change to make?<br>
<br>
Best regards,<br>
Thomas<br>
<br>
&gt; Alex<br>
&gt; <br>
&gt; On Thu, 30 Sept 2021 at 16:08, Thomas Perrot &lt;<br>
&gt; <a href="mailto:thomas.perrot@bootlin.com" \
target="_blank">thomas.perrot@bootlin.com</a>&gt; wrote:<br> &gt; &gt; Backport a \
patch to fix the below ptest failure:<br> &gt; &gt;   # ./run-ptest<br>
&gt; &gt;   Running tests:<br>
&gt; &gt;   EVPORT<br>
&gt; &gt;   Skipping test<br>
&gt; &gt;   KQUEUE<br>
&gt; &gt;   Skipping test<br>
&gt; &gt;   EPOLL<br>
&gt; &gt;   test-eof: OKAY<br>
&gt; &gt;   test-dumpevents: OKAY (output not checked)<br>
&gt; &gt;   regress:<br>
&gt; &gt;    FAIL ../libevent-2.1.12-stable/test/regress_util.c:1478:<br>
&gt; &gt; assert(diff.tv_sec == 0): 1 vs 0 util/monotonic_prc_fallback:<br>
&gt; &gt;    [monotonic_prc_fallback FAILED]<br>
&gt; &gt;   1/312 TESTS FAILED. (33 skipped)<br>
&gt; &gt;   FAILED<br>
&gt; &gt;   regress_debug:<br>
&gt; &gt;    FAIL ../libevent-2.1.12-stable/test/regress_util.c:1478:<br>
&gt; &gt; assert(diff.tv_sec == 0): 1 vs 0 util/monotonic_prc_fallback:<br>
&gt; &gt;    [monotonic_prc_fallback FAILED]<br>
&gt; &gt;   1/312 TESTS FAILED. (33 skipped)<br>
&gt; &gt;   FAILED<br>
&gt; &gt;   [snip]<br>
&gt; &gt; <br>
&gt; &gt; (From OE-Core rev: edecbbdacab5227c75e4a199e124389f8036b421)<br>
&gt; &gt; <br>
&gt; &gt; [YOCTO #14507]<br>
&gt; &gt; <br>
&gt; &gt; Signed-off-by: Mingli Yu &lt;<a href="mailto:mingli.yu@windriver.com" \
target="_blank">mingli.yu@windriver.com</a>&gt;<br> &gt; &gt; Signed-off-by: \
Alexandre Belloni &lt;<a href="mailto:alexandre.belloni@bootlin.com" \
target="_blank">alexandre.belloni@bootlin.com</a>&gt;<br> &gt; &gt; Signed-off-by: \
Thomas Perrot &lt;<a href="mailto:thomas.perrot@bootlin.com" \
target="_blank">thomas.perrot@bootlin.com</a>&gt;<br> &gt; &gt; ---<br>
&gt; &gt;   ...-monotonic_prc_fallback-as-retriable.patch | 28 +++++++<br>
&gt; &gt;   ...ts-are-marked-failed-only-when-all-a.patch | 81<br>
&gt; &gt; +++++++++++++++++++<br>
&gt; &gt;   .../libevent/libevent/run-ptest                       | 10 +--<br>
&gt; &gt;   .../libevent/<a href="http://libevent_2.1.12.bb" rel="noreferrer" \
target="_blank">libevent_2.1.12.bb</a>                       |   4 +-<br> &gt; &gt;   \
4 files changed, 117 insertions(+), 6 deletions(-)<br> &gt; &gt;   create mode 100644 \
meta/recipes-support/libevent/libevent/0003-test-<br> &gt; &gt; \
mark-util-monotonic_prc_fallback-as-retriable.patch<br> &gt; &gt;   create mode \
100644 meta/recipes-support/libevent/libevent/0004-test-<br> &gt; &gt; \
retriable-tests-are-marked-failed-only-when-all-a.patch<br> &gt; &gt; <br>
&gt; &gt; diff --git a/meta/recipes-support/libevent/libevent/0003-test-mark-<br>
&gt; &gt; util-monotonic_prc_fallback-as-retriable.patch b/meta/recipes-<br>
&gt; &gt; support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-<br>
&gt; &gt; as-retriable.patch<br>
&gt; &gt; new file mode 100644<br>
&gt; &gt; index 000000000000..ea322511d7e9<br>
&gt; &gt; --- /dev/null<br>
&gt; &gt; +++ b/meta/recipes-support/libevent/libevent/0003-test-mark-util-<br>
&gt; &gt; monotonic_prc_fallback-as-retriable.patch<br>
&gt; &gt; @@ -0,0 +1,28 @@<br>
&gt; &gt; +From 5a9a5faf27d85c89b40fb610cd23a4b62a7dbf0e Mon Sep 17 00:00:00<br>
&gt; &gt; 2001<br>
&gt; &gt; +From: Azat Khuzhin &lt;<a href="mailto:azat@libevent.org" \
target="_blank">azat@libevent.org</a>&gt;<br> &gt; &gt; +Date: Sun, 19 Sep 2021 \
00:57:31 +0300<br> &gt; &gt; +Subject: [PATCH] test: mark util/monotonic_prc_fallback \
as retriable<br> &gt; &gt; +<br>
&gt; &gt; +Refs: #1193<br>
&gt; &gt; +<br>
&gt; &gt; +Upstream-status: Backported<br>
&gt; &gt; [<br>
&gt; &gt; <a href="https://github.com/libevent/libevent/commit/04fcd7c6df158bb65261867de4b9ec8439696934" \
rel="noreferrer" target="_blank">https://github.com/libevent/libevent/commit/04fcd7c6df158bb65261867de4b9ec8439696934</a><br>
 &gt; &gt; ]<br>
&gt; &gt; +---<br>
&gt; &gt; + test/regress_util.c | 2 +-<br>
&gt; &gt; + 1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; &gt; +<br>
&gt; &gt; +diff --git a/test/regress_util.c b/test/regress_util.c<br>
&gt; &gt; +index 45caa2700a40..a9e80db20149 100644<br>
&gt; &gt; +--- a/test/regress_util.c<br>
&gt; &gt; ++++ b/test/regress_util.c<br>
&gt; &gt; +@@ -1672,7 +1672,7 @@ struct testcase_t util_testcases[] = {<br>
&gt; &gt; +           { &quot;monotonic_res_fallback&quot;, \
test_evutil_monotonic_res,<br> &gt; &gt; TT_OFF_BY_DEFAULT, &amp;basic_setup, \
(void*)&quot;fallback&quot; },<br> &gt; &gt; +           { &quot;monotonic_prc&quot;, \
test_evutil_monotonic_prc, 0,<br> &gt; &gt; &amp;basic_setup, (void*)&quot;&quot; \
},<br> &gt; &gt; +           { &quot;monotonic_prc_precise&quot;, \
test_evutil_monotonic_prc,<br> &gt; &gt; TT_RETRIABLE, &amp;basic_setup, \
(void*)&quot;precise&quot; },<br> &gt; &gt; +-         { \
&quot;monotonic_prc_fallback&quot;, test_evutil_monotonic_prc, 0,<br> &gt; &gt; \
&amp;basic_setup, (void*)&quot;fallback&quot; },<br> &gt; &gt; ++         { \
&quot;monotonic_prc_fallback&quot;, test_evutil_monotonic_prc,<br> &gt; &gt; \
TT_RETRIABLE, &amp;basic_setup, (void*)&quot;fallback&quot; },<br> &gt; &gt; +        \
{ &quot;date_rfc1123&quot;, test_evutil_date_rfc1123, 0, NULL, NULL },<br> &gt; &gt; \
+           { &quot;evutil_v4addr_is_local&quot;, test_evutil_v4addr_is_local, 0,<br> \
&gt; &gt; NULL, NULL },<br> &gt; &gt; +           { \
&quot;evutil_v6addr_is_local&quot;, test_evutil_v6addr_is_local, 0,<br> &gt; &gt; \
NULL, NULL },<br> &gt; &gt; +-- <br>
&gt; &gt; +2.31.1<br>
&gt; &gt; +<br>
&gt; &gt; diff --git a/meta/recipes-support/libevent/libevent/0004-test-<br>
&gt; &gt; retriable-tests-are-marked-failed-only-when-all-a.patch<br>
&gt; &gt; b/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-<br>
&gt; &gt; are-marked-failed-only-when-all-a.patch<br>
&gt; &gt; new file mode 100644<br>
&gt; &gt; index 000000000000..ae7db0b7aa85<br>
&gt; &gt; --- /dev/null<br>
&gt; &gt; +++ b/meta/recipes-support/libevent/libevent/0004-test-retriable-<br>
&gt; &gt; tests-are-marked-failed-only-when-all-a.patch<br>
&gt; &gt; @@ -0,0 +1,81 @@<br>
&gt; &gt; +From 36ebd92fa53c0097f1e2f9ec5aa5b5c6ec1b411d Mon Sep 17 00:00:00<br>
&gt; &gt; 2001<br>
&gt; &gt; +From: Thomas Perrot &lt;<a href="mailto:thomas.perrot@bootlin.com" \
target="_blank">thomas.perrot@bootlin.com</a>&gt;<br> &gt; &gt; +Date: Wed, 29 Sep \
2021 13:50:35 +0200<br> &gt; &gt; +Subject: [PATCH] test: retriable tests are marked \
failed only when<br> &gt; &gt; all<br>
&gt; &gt; + attempts have failed<br>
&gt; &gt; +<br>
&gt; &gt; +Fixes: #1193<br>
&gt; &gt; +<br>
&gt; &gt; +Upstream-status: Pending<br>
&gt; &gt; +<br>
&gt; &gt; +Signed-off-by: Thomas Perrot &lt;<a \
href="mailto:thomas.perrot@bootlin.com" \
target="_blank">thomas.perrot@bootlin.com</a>&gt;<br> &gt; &gt; +---<br>
&gt; &gt; + test/tinytest.c | 13 ++++++-------<br>
&gt; &gt; + test/tinytest.h |   2 +-<br>
&gt; &gt; + 2 files changed, 7 insertions(+), 8 deletions(-)<br>
&gt; &gt; +<br>
&gt; &gt; +diff --git a/test/tinytest.c b/test/tinytest.c<br>
&gt; &gt; +index 85dfe74a720e..bf2882418eb6 100644<br>
&gt; &gt; +--- a/test/tinytest.c<br>
&gt; &gt; ++++ b/test/tinytest.c<br>
&gt; &gt; +@@ -310,7 +310,8 @@ testcase_run_forked_(const struct testgroup_t<br>
&gt; &gt; *group,<br>
&gt; &gt; + <br>
&gt; &gt; + int<br>
&gt; &gt; + testcase_run_one(const struct testgroup_t *group,<br>
&gt; &gt; +-                       const struct testcase_t *testcase)<br>
&gt; &gt; ++                       const struct testcase_t *testcase,<br>
&gt; &gt; ++                       const int test_attempts)<br>
&gt; &gt; + {<br>
&gt; &gt; +           enum outcome outcome;<br>
&gt; &gt; + <br>
&gt; &gt; +@@ -348,7 +349,7 @@ testcase_run_one(const struct testgroup_t<br>
&gt; &gt; *group,<br>
&gt; &gt; +                       if (opt_verbosity&gt;0 &amp;&amp; !opt_forked)<br>
&gt; &gt; +                                   puts(&quot;SKIPPED&quot;);<br>
&gt; &gt; +           } else {<br>
&gt; &gt; +-                     if (!opt_forked)<br>
&gt; &gt; ++                     if (!opt_forked &amp;&amp; (testcase-&gt;flags &amp; \
TT_RETRIABLE)<br> &gt; &gt; &amp;&amp; !test_attempts)<br>
&gt; &gt; +                                   printf(&quot;\n   [%s FAILED]\n&quot;, \
testcase-&gt;name);<br> &gt; &gt; +           }<br>
&gt; &gt; + <br>
&gt; &gt; +@@ -525,22 +526,20 @@ tinytest_main(int c, const char **v, struct<br>
&gt; &gt; testgroup_t *groups)<br>
&gt; &gt; +                       struct testgroup_t *group = &amp;groups[i];<br>
&gt; &gt; +                       for (j = 0; group-&gt;cases[j].name; ++j) {<br>
&gt; &gt; +                                   struct testcase_t *testcase = \
&amp;group-<br> &gt; &gt; &gt; cases[j];<br>
&gt; &gt; +-                                 int test_attempts = 3;<br>
&gt; &gt; ++                                 int test_attempts = (testcase-&gt;flags \
&amp;<br> &gt; &gt; TT_RETRIABLE) ? 3: 1;<br>
&gt; &gt; +                                   int test_ret_err;<br>
&gt; &gt; + <br>
&gt; &gt; +                                   if (!(testcase-&gt;flags &amp; \
TT_ENABLED_))<br> &gt; &gt; +                                               \
continue;<br> &gt; &gt; + <br>
&gt; &gt; +                                   for (;;) {<br>
&gt; &gt; +-                                             test_ret_err =<br>
&gt; &gt; testcase_run_one(group, testcase);<br>
&gt; &gt; ++                                             test_ret_err =<br>
&gt; &gt; testcase_run_one(group, testcase, test_attempts);<br>
&gt; &gt; + <br>
&gt; &gt; +                                               if (test_ret_err == OK)<br>
&gt; &gt; +                                                           break;<br>
&gt; &gt; +-                                             if (!(testcase-&gt;flags \
&amp;<br> &gt; &gt; TT_RETRIABLE))<br>
&gt; &gt; ++                                             if (!--test_attempts)<br>
&gt; &gt; +                                                           break;<br>
&gt; &gt; +                                               printf(&quot;\n   [RETRYING \
%s (%i)]\n&quot;,<br> &gt; &gt; testcase-&gt;name, test_attempts);<br>
&gt; &gt; +-                                             if (!test_attempts--)<br>
&gt; &gt; +-                                                         break;<br>
&gt; &gt; +                                   }<br>
&gt; &gt; + <br>
&gt; &gt; +                                   switch (test_ret_err) {<br>
&gt; &gt; +diff --git a/test/tinytest.h b/test/tinytest.h<br>
&gt; &gt; +index d321dd467542..c276b5339331 100644<br>
&gt; &gt; +--- a/test/tinytest.h<br>
&gt; &gt; ++++ b/test/tinytest.h<br>
&gt; &gt; +@@ -92,7 +92,7 @@ char *tinytest_format_hex_(const void *, unsigned<br>
&gt; &gt; long);<br>
&gt; &gt; +           tinytest_set_flag_(groups, named, 1, TT_SKIP)<br>
&gt; &gt; + <br>
&gt; &gt; + /** Run a single testcase in a single group. */<br>
&gt; &gt; +-int testcase_run_one(const struct testgroup_t *,const struct<br>
&gt; &gt; testcase_t *);<br>
&gt; &gt; ++int testcase_run_one(const struct testgroup_t *,const struct<br>
&gt; &gt; testcase_t *, const int test_attempts);<br>
&gt; &gt; + <br>
&gt; &gt; + void tinytest_set_aliases(const struct testlist_alias_t *aliases);<br>
&gt; &gt; + <br>
&gt; &gt; +-- <br>
&gt; &gt; +2.31.1<br>
&gt; &gt; +<br>
&gt; &gt; diff --git a/meta/recipes-support/libevent/libevent/run-ptest<br>
&gt; &gt; b/meta/recipes-support/libevent/libevent/run-ptest<br>
&gt; &gt; index d3b5e793c3c5..ef4260d1c413 100644<br>
&gt; &gt; --- a/meta/recipes-support/libevent/libevent/run-ptest<br>
&gt; &gt; +++ b/meta/recipes-support/libevent/libevent/run-ptest<br>
&gt; &gt; @@ -1,14 +1,14 @@<br>
&gt; &gt;   #!/bin/sh<br>
&gt; &gt; <br>
&gt; &gt;   # run-ptest - &#39;ptest&#39; test infrastructure shell script that<br>
&gt; &gt; -#     wraps the libevent test scripts <br>
&gt; &gt; +#     wraps the libevent test scripts<br>
&gt; &gt;   #<br>
&gt; &gt;   # Trevor Gamblin &lt;<a href="mailto:trevor.gamblin@windriver.com" \
target="_blank">trevor.gamblin@windriver.com</a>&gt;<br> &gt; &gt;   \
###############################################################<br> &gt; &gt;   \
LIBEVENTLIB=@libdir@/libevent<br> &gt; &gt;   \
LOG=&quot;${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log&quot;<br> \
&gt; &gt; <br> &gt; &gt; -cd ${LIBEVENTLIB}/ptest <br>
&gt; &gt; +cd ${LIBEVENTLIB}/ptest<br>
&gt; &gt; <br>
&gt; &gt;   # Run only the libevent &quot;regress&quot; test. All other test scripts \
in<br> &gt; &gt; the<br>
&gt; &gt;   # libevent &quot;test&quot; folder are related to performance, e.g. \
read/write<br> &gt; &gt; @@ -16,9 +16,9 @@ cd ${LIBEVENTLIB}/ptest<br>
&gt; &gt;   # in the ptest log.<br>
&gt; &gt;   ./test/regress 2&gt;&amp;1| sed -e &#39;/TESTS/d&#39; -e \
&#39;/tests/d&#39; -e &#39;/OK/<br> &gt; &gt; s/^/PASS: / ; /FAILED/ s/^/FAIL: / ; \
/SKIPPED/ s/^/SKIP: / ;<br> &gt; &gt; /DISABLED/ s/^/SKIP: /&#39; | cut -f1,2 -d \
&#39;:&#39; | tee -a ${LOG}<br> &gt; &gt; <br>
&gt; &gt; -passed=`grep PASS ${LOG}|wc -l`<br>
&gt; &gt; -failed=`grep FAIL ${LOG}|wc -l`<br>
&gt; &gt; -skipped=`grep -E SKIP ${LOG}|wc -l`<br>
&gt; &gt; +passed=`grep PASS: ${LOG}|wc -l`<br>
&gt; &gt; +failed=`grep FAIL: ${LOG}|wc -l`<br>
&gt; &gt; +skipped=`grep -E SKIP: ${LOG}|wc -l`<br>
&gt; &gt;   all=$((passed + failed + skipped))<br>
&gt; &gt; <br>
&gt; &gt;   (     echo &quot;=== Test Summary ===&quot;<br>
&gt; &gt; diff --git a/meta/recipes-support/libevent/<a \
href="http://libevent_2.1.12.bb" rel="noreferrer" \
target="_blank">libevent_2.1.12.bb</a><br> &gt; &gt; \
b/meta/recipes-support/libevent/<a href="http://libevent_2.1.12.bb" rel="noreferrer" \
target="_blank">libevent_2.1.12.bb</a><br> &gt; &gt; index 4b419eab226d..e26e8a9b5725 \
100644<br> &gt; &gt; --- a/meta/recipes-support/libevent/<a \
href="http://libevent_2.1.12.bb" rel="noreferrer" \
target="_blank">libevent_2.1.12.bb</a><br> &gt; &gt; +++ \
b/meta/recipes-support/libevent/<a href="http://libevent_2.1.12.bb" rel="noreferrer" \
target="_blank">libevent_2.1.12.bb</a><br> &gt; &gt; @@ -16,6 +16,8 @@ SRC_URI =<br>
&gt; &gt; &quot;<br>
&gt; &gt; <a href="https://github.com/libevent/libevent/releases/download/release-$%7BPV%7D-" \
rel="noreferrer" target="_blank">https://github.com/libevent/libevent/releases/download/release-${PV}-</a><br>
 &gt; &gt;                   file://run-ptest \<br>
&gt; &gt;                   file://0001-test-regress_dns.c-patch-out-tests-that-<br>
&gt; &gt; require-a-wo.patch \<br>
&gt; &gt;                   file://0002-test-regress.h-Increase-default-timeval-<br>
&gt; &gt; tolerance-50.patch \<br>
&gt; &gt; +                 file://0003-test-mark-util-monotonic_prc_fallback-as-<br>
&gt; &gt; retriable.patch \<br>
&gt; &gt; +                 \
file://0004-test-retriable-tests-are-marked-failed-only-<br> &gt; &gt; \
when-all-a.patch \<br> &gt; &gt;                   &quot;<br>
&gt; &gt; <br>
&gt; &gt;   SRC_URI[sha256sum] =<br>
&gt; &gt; &quot;92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb&quot;<br>
 &gt; &gt; @@ -56,7 +58,7 @@ do_install_ptest() {<br>
&gt; &gt;             do<br>
&gt; &gt;                         install -m 0755 $file ${D}${PTEST_PATH}/test<br>
&gt; &gt;             done<br>
&gt; &gt; -            <br>
&gt; &gt; +<br>
&gt; &gt;               # handle multilib<br>
&gt; &gt;               sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest<br>
&gt; &gt;   }<br>
<br>
-- <br>
Thomas Perrot, Bootlin<br>
Embedded Linux and kernel engineering<br>
<a href="https://bootlin.com" rel="noreferrer" \
target="_blank">https://bootlin.com</a><br> <br>
</blockquote></div>



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156504): https://lists.openembedded.org/g/openembedded-core/message/156504
Mute This Topic: https://lists.openembedded.org/mt/85974461/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic