summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-07-07 10:04:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-08 14:58:28 +0100
commit486a35a67413ce938c4a9ebb50aed20903c0ae82 (patch)
tree8bbc0cb4f7d59db5cf50d55ab7b25c8f7d3e2dad
parent287745a09d0fab611137f708cb62c8e1e55b654f (diff)
downloadpoky-486a35a67413ce938c4a9ebb50aed20903c0ae82.tar.gz
glib-2.0: fix g-file-into modification time test
The GFileInfo modification time test assumed that the difference between a modification timestamp in seconds and in microseconds must be greater than 0. Mathmatically, there's a one-in-a-million chance that it will be 0. It turns out that one-in-a-million chances happen approximately once every fortnight on the autobuilder. [ YOCTO 14373 ] (From OE-Core rev: 7d2bd897fdbcf5215bf2287cb96eb6b58803f08c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/time-test.patch40
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/time-test.patch b/meta/recipes-core/glib-2.0/glib-2.0/time-test.patch
new file mode 100644
index 0000000000..4d7ef97bb5
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/time-test.patch
@@ -0,0 +1,40 @@
1Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2177]
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 289f8be1b397a453cfcf35641455f3ae5fb4faeb Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Tue, 6 Jul 2021 19:26:03 +0100
7Subject: [PATCH] gio/tests/g-file-info: don't assume million-in-one events
8 don't happen
9
10The modification time test creates a file, gets the modification time in
11seconds, then gets the modification time in microseconds and assumes
12that the difference between the two has to be above 0.
13
14As rare as this may be, it can happen:
15
16$ stat g-file-info-test-50A450 -c %y
172021-07-06 18:24:56.000000767 +0100
18
19Change the test to simply assert that the difference not negative to
20handle this case.
21---
22 gio/tests/g-file-info.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c
26index c11c50462..fd0c64b55 100644
27--- a/gio/tests/g-file-info.c
28+++ b/gio/tests/g-file-info.c
29@@ -178,7 +178,7 @@ test_g_file_info_modification_time (void)
30 g_assert_nonnull (dt_usecs);
31
32 ts = g_date_time_difference (dt_usecs, dt);
33- g_assert_cmpint (ts, >, 0);
34+ g_assert_cmpint (ts, >=, 0);
35 g_assert_cmpint (ts, <, G_USEC_PER_SEC);
36
37 /* Try round-tripping the modification time. */
38--
392.25.1
40
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb
index 2a3a00fada..62c8d49464 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb
@@ -17,6 +17,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
17 file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ 17 file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ 18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
19 file://0001-gio-tests-codegen.py-bump-timeout-to-100-seconds.patch \ 19 file://0001-gio-tests-codegen.py-bump-timeout-to-100-seconds.patch \
20 file://time-test.patch \
20 " 21 "
21SRC_URI_append_class-native = " file://relocate-modules.patch" 22SRC_URI_append_class-native = " file://relocate-modules.patch"
22 23