Skip to contentSkip to conversation

glib-networking: Fix ptest failures with openssl backend

PATCH In review Khem Raj 4 participants 11 messages Jan 9, 2024 – Jan 15, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v3 1/1 glib-networking: Fix ptest failures with openssl backend

---
v2: Make the patch apply only when openssl backend is used
v3: Move the backend check to source code of the test itself

 ...tion.c-Disable-unclean-close-by-serv.patch | 36 +++++++++++++++++++
 .../glib-networking/glib-networking_2.78.0.bb |  5 +--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch
meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch new file +36 -0
new file mode 100644
index 00000000000..be7fc586f40
@@ -0,0 +1,36 @@
+From fdcd8fbf23983d33327967f3e4249bba7c5a1b93 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 9 Jan 2024 11:15:21 -0800
+Subject: [PATCH] tls/tests/connection.c: Disable unclean-close-by-server with
+ openssl backend
+
+This test does not work when using openssl backend as reported here [1]
+
+Fixes
+
+not ok /tls/openssl/connection/unclean-close-by-server - GLib-Net:ERROR:../tls/tests/connection.c:2374:test_unclean_close_by_server: assertion failed (test->read_error == (g-tls-error-quark, 6)): Error reading data from TLS socket: error:00000005:lib(0)::reason(5) (g-tls-error-quark, 1) Bail out!
+stderr:
+**
+GLib-Net:ERROR:../tls/tests/connection.c:2374:test_unclean_close_by_server: assertion failed (test->read_error == (g-tls-error-quark, 6)): Error reading data from TLS socket: error:00000005:lib(0)::reason(5) (g-tls-error-quark, 1)
+
+[1] https://gitlab.gnome.org/GNOME/glib-networking/-/issues/219
+
+Upstream-Status: Inappropriate [ Disabled test as a workaround until fixed ]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tls/tests/connection.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/tls/tests/connection.c
++++ b/tls/tests/connection.c
+@@ -3466,8 +3466,10 @@ main (int   argc,
+               setup_connection, test_simultaneous_sync_rehandshake, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/close-immediately", TestConnection, NULL,
+               setup_connection, test_close_immediately, teardown_connection);
++  #ifndef BACKEND_IS_OPENSSL
+   g_test_add ("/tls/" BACKEND "/connection/unclean-close-by-server", TestConnection, NULL,
+               setup_connection, test_unclean_close_by_server, teardown_connection);
++  #endif
+   g_test_add ("/tls/" BACKEND "/connection/async-implicit-handshake", TestConnection, NULL,
+               setup_connection, test_async_implicit_handshake, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/output-stream-close", TestConnection, NULL,
meta/recipes-core/glib-networking/glib-networking_2.78.0.bb +3 -2
index 68f9a2ed783..3e83bb6ca3b 100644
@@ -30,8 +30,9 @@ PACKAGECONFIG[gnomeproxy] = "-Dgnome_proxy=enabled,-Dgnome_proxy=disabled,gsetti
 inherit gnomebase gettext upstream-version-is-even gio-module-cache ptest-gnome
 
 SRC_URI += "file://run-ptest"
-SRC_URI += "file://eagain.patch"
-
+SRC_URI += "file://eagain.patch \
+            file://0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch \
+            "
 FILES:${PN} += "\
                 ${libdir}/gio/modules/libgio*.so \
                 ${datadir}/dbus-1/services/ \
Signature · 1 line
2.43.0
#1 lore raw

Patchtest results for [PATCH v3] glib-networking: Fix ptest failures with openssl backend

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/v3-glib-networking-Fix-ptest-failures-with-openssl-backend.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#2 lore raw
In reply to Khem Raj

meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch line 33

Quoted 4 lines · Khem Raj via lists.openembedded.org

++ #ifndef BACKEND_IS_OPENSSL

meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch new file +3 -0
+   g_test_add ("/tls/" BACKEND "/connection/unclean-close-by-server", TestConnection, NULL,
+               setup_connection, test_unclean_close_by_server, teardown_connection);
++  #endif

Personally, unless upstream say “yes this test doesn’t work on openssl yet” and mark it as such, this is still a test failure that is failing for unknown reasons.

We could #if 0 out every test that failed and rejoice in our 100% pass test cases but that would be a terrible idea, so why is this different?

Ross

#3 lore raw
Quoted 10 lines · Ross Burton

meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch line 33

Quoted 4 lines · Khem Raj via lists.openembedded.org

++ #ifndef BACKEND_IS_OPENSSL

meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-connection.c-Disable-unclean-close-by-serv.patch new file +3 -0
+   g_test_add ("/tls/" BACKEND "/connection/unclean-close-by-server", TestConnection, NULL,
+               setup_connection, test_unclean_close_by_server, teardown_connection);
++  #endif

Personally, unless upstream say “yes this test doesn’t work on openssl yet” and mark it as such, this is still a test failure that is failing for unknown reasons.

We could #if 0 out every test that failed and rejoice in our 100% pass test cases but that would be a terrible idea, so why is this different?

This is what we already do for intermittently failing ptests all over the stack. Rejoice!

This issue is reported upstream, and the link is in the patch. Yes, given sufficient time one can become an expert in intricacies of glib, openssl, and their interaction, and then develop a real fix all by themselves, but I think a more fair expectation is exactly what Khem is doing: report upstream, add a reasonable workaround, follow up upstream requests in the reported ticket.

Alex

#4 lore raw
Quoted 4 lines · Alexander Kanavin
Quoted 1 line

We could #if 0 out every test that failed and rejoice in our 100% pass test cases but that would be a terrible idea, so why is this different?

This is what we already do for intermittently failing ptests all over the stack. Rejoice!

Hopefully we assess the test and determine if the odds are good that it is in fact timing related before doing this!

Quoted 6 lines

This issue is reported upstream, and the link is in the patch. Yes, given sufficient time one can become an expert in intricacies of glib, openssl, and their interaction, and then develop a real fix all by themselves, but I think a more fair expectation is exactly what Khem is doing: report upstream, add a reasonable workaround, follow up upstream requests in the reported ticket.

This is a configuration that upstream doesn’t support and we don’t enable by default, so I’m leaning towards Khem carries the patch alongside the bbappend to turn on the openssl backend in the first place.

Ross

#5 lore raw
Quoted 8 lines · Ross Burton
Quoted 6 lines

This issue is reported upstream, and the link is in the patch. Yes, given sufficient time one can become an expert in intricacies of glib, openssl, and their interaction, and then develop a real fix all by themselves, but I think a more fair expectation is exactly what Khem is doing: report upstream, add a reasonable workaround, follow up upstream requests in the reported ticket.

This is a configuration that upstream doesn’t support and we don’t enable by default, so I’m leaning towards Khem carries the patch alongside the bbappend to turn on the openssl backend in the first place.

With this I agree. I don't think oe-core should carry patches for configurations it doesn't test.

Alex

author
#6 lore raw
In reply to Ross Burton
Quoted 18 lines · Ross Burton
Quoted 1 line · Alexander Kanavin
Quoted 1 line

We could #if 0 out every test that failed and rejoice in our 100% pass

test cases but that would be a terrible idea, so why is this different?

Quoted 3 lines

This is what we already do for intermittently failing ptests all over the stack. Rejoice!

Hopefully we assess the test and determine if the odds are good that it is in fact timing related before doing this!

Quoted 6 lines

This issue is reported upstream, and the link is in the patch. Yes, given sufficient time one can become an expert in intricacies of glib, openssl, and their interaction, and then develop a real fix all by themselves, but I think a more fair expectation is exactly what Khem is doing: report upstream, add a reasonable workaround, follow up upstream requests in the reported ticket.

Quoted 3 lines

This is a configuration that upstream doesn’t support and we don’t enable by default, so I’m leaning towards Khem carries the patch alongside the bbappend to turn on the openssl backend in the first place.

Where does it say it does not support? On the contrary there are patches in this area sent recently

Yes I can carry all of changes we need locally that’s not an issue we are already carrying many of them they just make it harder to contribute back to project as these pile up

Quoted 2 lines

Ross

author
#8 lore raw
Quoted 8 lines · Ross Burton
Quoted 5 lines · Khem Raj

Where does it say it does not support? On the contrary there are patches in this area sent recently

https://gitlab.gnome.org/GNOME/glib-networking/-/commit/8e1d80c1e0fc52d17d08a21946fa4a86ec30e1db

Right, it was 3 years ago and note the mention kind of systems where it maybe in use :) and OE is used for such
distros so it might be useful. The fixes to get openssl support improved have happened after this commit.
Its fine if we do not want to accept patches here and wait upstream to support it fully. Because than it's easier to direct upstream work correctly. We just have to be clear with these criterias in general.

Quoted 1 line

Ross

author
#9 lore raw
Quoted 11 lines · Khem Raj
Quoted 8 lines · Ross Burton
Quoted 5 lines · Khem Raj

Where does it say it does not support? On the contrary there are patches in this area sent recently

https://gitlab.gnome.org/GNOME/glib-networking/-/commit/8e1d80c1e0fc52d17d08a21946fa4a86ec30e1db

Quoted 8 lines

Right, it was 3 years ago and note the mention kind of systems where it maybe in use :) and OE is used for such
distros so it might be useful. The fixes to get openssl support improved have happened after this commit.
Its fine if we do not want to accept patches here and wait upstream to support it fully. Because than it's easier to direct upstream work correctly. We just have to be clear with these criterias in general.

Lets drop this patch.

Quoted 2 lines
Quoted 2 lines

Ross

author
#10 lore raw
In reply to Ross Burton
Quoted 7 lines · Ross Burton
Quoted 2 lines · Khem Raj via lists.openembedded.org

++ #ifndef BACKEND_IS_OPENSSL
+ g_test_add ("/tls/" BACKEND "/connection/unclean-close-by-server",

TestConnection, NULL,

Quoted 1 line

+ setup_connection, test_unclean_close_by_server,

teardown_connection);

Quoted 9 lines
Quoted 1 line

++ #endif

Personally, unless upstream say “yes this test doesn’t work on openssl yet” and mark it as such, this is still a test failure that is failing for unknown reasons.

We could #if 0 out every test that failed and rejoice in our 100% pass test cases but that would be a terrible idea, so why is this different?

This however is not the case here. Upstream has accepted the bug already and marked it so as well. I am not sure why we should act more stricter in accepting patches than upstream activity here.

Quoted 1 line

Ross