diff options
| author | Thomas Perrot <thomas.perrot@bootlin.com> | 2021-09-29 17:02:04 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-01 14:51:45 +0100 |
| commit | c619d748ab7ef08b189a4c8bb0f4f98fd8551930 (patch) | |
| tree | 44bfbf99a0fafb8c16d6db9a03aaf44986383274 /meta/recipes-support/libevent | |
| parent | 3ac9722e0fb0276f9083cc5ee561eb2518fa060c (diff) | |
| download | poky-c619d748ab7ef08b189a4c8bb0f4f98fd8551930.tar.gz | |
libevent: mark util/monotonic_prc_fallback as retriable
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]
(From OE-Core rev: cae0eb03e8e754bd77651fc017b2669f8fd57f75)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libevent')
4 files changed, 117 insertions, 6 deletions
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 0000000000..8a2c78983e --- /dev/null +++ b/meta/recipes-support/libevent/libevent/0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From d01a57a998798da977c470f3b8d6a457c1adb144 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Azat Khuzhin <azat@libevent.org> | ||
| 3 | Date: Sun, 19 Sep 2021 00:57:31 +0300 | ||
| 4 | Subject: [PATCH] test: mark util/monotonic_prc_fallback as retriable | ||
| 5 | |||
| 6 | Refs: #1193 | ||
| 7 | |||
| 8 | Upstream-status: Backported | ||
| 9 | --- | ||
| 10 | test/regress_util.c | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/test/regress_util.c b/test/regress_util.c | ||
| 14 | index 45caa2700a40..a9e80db20149 100644 | ||
| 15 | --- a/test/regress_util.c | ||
| 16 | +++ b/test/regress_util.c | ||
| 17 | @@ -1672,7 +1672,7 @@ struct testcase_t util_testcases[] = { | ||
| 18 | { "monotonic_res_fallback", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" }, | ||
| 19 | { "monotonic_prc", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"" }, | ||
| 20 | { "monotonic_prc_precise", test_evutil_monotonic_prc, TT_RETRIABLE, &basic_setup, (void*)"precise" }, | ||
| 21 | - { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" }, | ||
| 22 | + { "monotonic_prc_fallback", test_evutil_monotonic_prc, TT_RETRIABLE, &basic_setup, (void*)"fallback" }, | ||
| 23 | { "date_rfc1123", test_evutil_date_rfc1123, 0, NULL, NULL }, | ||
| 24 | { "evutil_v4addr_is_local", test_evutil_v4addr_is_local, 0, NULL, NULL }, | ||
| 25 | { "evutil_v6addr_is_local", test_evutil_v6addr_is_local, 0, NULL, NULL }, | ||
| 26 | -- | ||
| 27 | 2.31.1 | ||
| 28 | |||
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 0000000000..ae7db0b7aa --- /dev/null +++ b/meta/recipes-support/libevent/libevent/0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | From 36ebd92fa53c0097f1e2f9ec5aa5b5c6ec1b411d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Thomas Perrot <thomas.perrot@bootlin.com> | ||
| 3 | Date: Wed, 29 Sep 2021 13:50:35 +0200 | ||
| 4 | Subject: [PATCH] test: retriable tests are marked failed only when all | ||
| 5 | attempts have failed | ||
| 6 | |||
| 7 | Fixes: #1193 | ||
| 8 | |||
| 9 | Upstream-status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> | ||
| 12 | --- | ||
| 13 | test/tinytest.c | 13 ++++++------- | ||
| 14 | test/tinytest.h | 2 +- | ||
| 15 | 2 files changed, 7 insertions(+), 8 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/test/tinytest.c b/test/tinytest.c | ||
| 18 | index 85dfe74a720e..bf2882418eb6 100644 | ||
| 19 | --- a/test/tinytest.c | ||
| 20 | +++ b/test/tinytest.c | ||
| 21 | @@ -310,7 +310,8 @@ testcase_run_forked_(const struct testgroup_t *group, | ||
| 22 | |||
| 23 | int | ||
| 24 | testcase_run_one(const struct testgroup_t *group, | ||
| 25 | - const struct testcase_t *testcase) | ||
| 26 | + const struct testcase_t *testcase, | ||
| 27 | + const int test_attempts) | ||
| 28 | { | ||
| 29 | enum outcome outcome; | ||
| 30 | |||
| 31 | @@ -348,7 +349,7 @@ testcase_run_one(const struct testgroup_t *group, | ||
| 32 | if (opt_verbosity>0 && !opt_forked) | ||
| 33 | puts("SKIPPED"); | ||
| 34 | } else { | ||
| 35 | - if (!opt_forked) | ||
| 36 | + if (!opt_forked && (testcase->flags & TT_RETRIABLE) && !test_attempts) | ||
| 37 | printf("\n [%s FAILED]\n", testcase->name); | ||
| 38 | } | ||
| 39 | |||
| 40 | @@ -525,22 +526,20 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) | ||
| 41 | struct testgroup_t *group = &groups[i]; | ||
| 42 | for (j = 0; group->cases[j].name; ++j) { | ||
| 43 | struct testcase_t *testcase = &group->cases[j]; | ||
| 44 | - int test_attempts = 3; | ||
| 45 | + int test_attempts = (testcase->flags & TT_RETRIABLE) ? 3: 1; | ||
| 46 | int test_ret_err; | ||
| 47 | |||
| 48 | if (!(testcase->flags & TT_ENABLED_)) | ||
| 49 | continue; | ||
| 50 | |||
| 51 | for (;;) { | ||
| 52 | - test_ret_err = testcase_run_one(group, testcase); | ||
| 53 | + test_ret_err = testcase_run_one(group, testcase, test_attempts); | ||
| 54 | |||
| 55 | if (test_ret_err == OK) | ||
| 56 | break; | ||
| 57 | - if (!(testcase->flags & TT_RETRIABLE)) | ||
| 58 | + if (!--test_attempts) | ||
| 59 | break; | ||
| 60 | printf("\n [RETRYING %s (%i)]\n", testcase->name, test_attempts); | ||
| 61 | - if (!test_attempts--) | ||
| 62 | - break; | ||
| 63 | } | ||
| 64 | |||
| 65 | switch (test_ret_err) { | ||
| 66 | diff --git a/test/tinytest.h b/test/tinytest.h | ||
| 67 | index d321dd467542..c276b5339331 100644 | ||
| 68 | --- a/test/tinytest.h | ||
| 69 | +++ b/test/tinytest.h | ||
| 70 | @@ -92,7 +92,7 @@ char *tinytest_format_hex_(const void *, unsigned long); | ||
| 71 | tinytest_set_flag_(groups, named, 1, TT_SKIP) | ||
| 72 | |||
| 73 | /** Run a single testcase in a single group. */ | ||
| 74 | -int testcase_run_one(const struct testgroup_t *,const struct testcase_t *); | ||
| 75 | +int testcase_run_one(const struct testgroup_t *,const struct testcase_t *, const int test_attempts); | ||
| 76 | |||
| 77 | void tinytest_set_aliases(const struct testlist_alias_t *aliases); | ||
| 78 | |||
| 79 | -- | ||
| 80 | 2.31.1 | ||
| 81 | |||
diff --git a/meta/recipes-support/libevent/libevent/run-ptest b/meta/recipes-support/libevent/libevent/run-ptest index d3b5e793c3..ef4260d1c4 100644 --- a/meta/recipes-support/libevent/libevent/run-ptest +++ b/meta/recipes-support/libevent/libevent/run-ptest | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # run-ptest - 'ptest' test infrastructure shell script that | 3 | # run-ptest - 'ptest' test infrastructure shell script that |
| 4 | # wraps the libevent test scripts | 4 | # wraps the libevent test scripts |
| 5 | # | 5 | # |
| 6 | # Trevor Gamblin <trevor.gamblin@windriver.com> | 6 | # Trevor Gamblin <trevor.gamblin@windriver.com> |
| 7 | ############################################################### | 7 | ############################################################### |
| 8 | LIBEVENTLIB=@libdir@/libevent | 8 | LIBEVENTLIB=@libdir@/libevent |
| 9 | LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log" | 9 | LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log" |
| 10 | 10 | ||
| 11 | cd ${LIBEVENTLIB}/ptest | 11 | cd ${LIBEVENTLIB}/ptest |
| 12 | 12 | ||
| 13 | # Run only the libevent "regress" test. All other test scripts in the | 13 | # Run only the libevent "regress" test. All other test scripts in the |
| 14 | # libevent "test" folder are related to performance, e.g. read/write | 14 | # libevent "test" folder are related to performance, e.g. read/write |
| @@ -16,9 +16,9 @@ cd ${LIBEVENTLIB}/ptest | |||
| 16 | # in the ptest log. | 16 | # in the ptest log. |
| 17 | ./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} | 17 | ./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} |
| 18 | 18 | ||
| 19 | passed=`grep PASS ${LOG}|wc -l` | 19 | passed=`grep PASS: ${LOG}|wc -l` |
| 20 | failed=`grep FAIL ${LOG}|wc -l` | 20 | failed=`grep FAIL: ${LOG}|wc -l` |
| 21 | skipped=`grep -E SKIP ${LOG}|wc -l` | 21 | skipped=`grep -E SKIP: ${LOG}|wc -l` |
| 22 | all=$((passed + failed + skipped)) | 22 | all=$((passed + failed + skipped)) |
| 23 | 23 | ||
| 24 | ( echo "=== Test Summary ===" | 24 | ( 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 4b419eab22..e26e8a9b57 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}- | |||
| 16 | file://run-ptest \ | 16 | file://run-ptest \ |
| 17 | file://0001-test-regress_dns.c-patch-out-tests-that-require-a-wo.patch \ | 17 | file://0001-test-regress_dns.c-patch-out-tests-that-require-a-wo.patch \ |
| 18 | file://0002-test-regress.h-Increase-default-timeval-tolerance-50.patch \ | 18 | file://0002-test-regress.h-Increase-default-timeval-tolerance-50.patch \ |
| 19 | file://0003-test-mark-util-monotonic_prc_fallback-as-retriable.patch \ | ||
| 20 | file://0004-test-retriable-tests-are-marked-failed-only-when-all-a.patch \ | ||
| 19 | " | 21 | " |
| 20 | 22 | ||
| 21 | SRC_URI[sha256sum] = "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb" | 23 | SRC_URI[sha256sum] = "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb" |
| @@ -56,7 +58,7 @@ do_install_ptest() { | |||
| 56 | do | 58 | do |
| 57 | install -m 0755 $file ${D}${PTEST_PATH}/test | 59 | install -m 0755 $file ${D}${PTEST_PATH}/test |
| 58 | done | 60 | done |
| 59 | 61 | ||
| 60 | # handle multilib | 62 | # handle multilib |
| 61 | sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest | 63 | sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest |
| 62 | } | 64 | } |
