After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727380 - Add error messages on OpenBSD to test log hooks
Add error messages on OpenBSD to test log hooks
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
git master
Other OpenBSD
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-31 11:16 UTC by Jasper Lievisse Adriaanse
Modified: 2015-05-14 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add error messages on OpenBSD to test log hooks (2.10 KB, patch)
2014-03-31 11:17 UTC, Jasper Lievisse Adriaanse
needs-work Details | Review
Bug 727380 - Fix test suite to work on OpenBSD (3.32 KB, patch)
2014-08-23 16:02 UTC, Garrett Regier
none Details | Review
Bug 727380 - Fix test suite to work on OpenBSD v2 (4.30 KB, patch)
2014-11-01 23:01 UTC, Garrett Regier
none Details | Review
Bug 727380 - Fix test suite to work on OpenBSD v2 (3.86 KB, patch)
2014-11-08 22:37 UTC, Garrett Regier
committed Details | Review
Debug patch (984 bytes, patch)
2014-11-12 22:33 UTC, Garrett Regier
none Details | Review
Fix Python tests on OpenBSD (1.53 KB, patch)
2015-05-12 12:07 UTC, Garrett Regier
committed Details | Review

Description Jasper Lievisse Adriaanse 2014-03-31 11:16:09 UTC
Currently the tests fail as OpenBSD prints a different error message when one of the plugins isn't found. This patch adds the message, however I had to make them conditional as otherwise the original log hooks wouldn't trigger.

OK to push as is, or is there a better way to handle this?
Comment 1 Jasper Lievisse Adriaanse 2014-03-31 11:17:01 UTC
Created attachment 273329 [details] [review]
Add error messages on OpenBSD to test log hooks
Comment 2 Jasper Lievisse Adriaanse 2014-08-10 11:50:17 UTC
Ping?
Comment 3 Garrett Regier 2014-08-10 14:50:44 UTC
Review of attachment 273329 [details] [review]:

Hey sorry about forgetting about this one!

I think the correct fix would be to modify the PeasObjectModule warnings to give a message like: "Failed to load module %s: %s" % (module_name, module_error).

Then just modify the current error hooks to instead check for those new and consistent error messages.

::: tests/libpeas/engine.c
@@ +393,3 @@
   testing_util_push_log_hook ("Could not load plugin loader 'does-not-exist'*");
   testing_util_push_log_hook ("Could not find loader 'does-not-exist' for*");
+  testing_util_push_log_hook ("does-not-existloader: File not found");

Why is this one not wrapped by #ifdef?
Comment 4 Garrett Regier 2014-08-23 16:02:26 UTC
Created attachment 284300 [details] [review]
Bug 727380 - Fix test suite to work on OpenBSD

Change the warnings so they can be checked properly in
the tests without relying on OS specific messages.



Does this work allow the test suite to pass on OpenBSD?
Comment 5 Jasper Lievisse Adriaanse 2014-08-29 08:31:31 UTC
Thanks for the patch, but it doesn't allow a pass on OpenBSD:

(./.libs/engine:3213): libpeas-ERROR **: Unhandled warning: libpeas: Failed to load module does-not-existloader: File not found

(./.libs/engine:3213): libpeas-ERROR **: Log hook was not triggered: 'Could not load plugin loader 'does-not-exist'*'
Comment 6 Jasper Lievisse Adriaanse 2014-08-29 08:38:55 UTC
with the following addition:

engine.c:test_engine_nonexistent_loader():
 testing_util_push_log_hook ("Failed to load module does-not-existloader: File not found");

The "engine", "extension-c", "extension-set" and "plugin-info" pass. Then python fails:

TEST: extension-python... (pid=6088)
  /extension/python/garbage-collect:                                   
(./.libs/extension-python:6088): libpeas-ERROR **: Unhandled warning: libpeas: Failed to load module pythonloader: File not found
Comment 7 Garrett Regier 2014-11-01 23:01:59 UTC
Created attachment 289816 [details] [review]
Bug 727380 - Fix test suite to work on OpenBSD v2

Forgot about the ignored warnings in testing-utils.
Comment 8 Garrett Regier 2014-11-08 22:37:36 UTC
Created attachment 290242 [details] [review]
Bug 727380 - Fix test suite to work on OpenBSD v2

Updated to apply to current git master
Comment 9 Jasper Lievisse Adriaanse 2014-11-12 10:44:09 UTC
That's much better though it finally fails with:

libpeas:ERROR:extension-py.c:196:test_extension_py_mixed_python: stderr of child process (/extension/python/mixed-python/subprocess [24688]) failed to match:
FAIL
GTester: last random seed: R02S38e79c1792427af6e504ed21cb126252
Terminated
Makefile:953: recipe for target 'test' failed
Comment 10 Garrett Regier 2014-11-12 22:33:15 UTC
Created attachment 290560 [details] [review]
Debug patch

Hmm very weird, no idea what would be causing that issue... I've attached a patch which will hopefully help debug this.

Running instructions (under Linux this works):
  libtool --mode=execute gdb --ex 'run -p /extension/python/mixed-python-subprocess' tests/libpeas/extension-python
Comment 11 Garrett Regier 2014-12-18 14:16:20 UTC
I committed an updated version of the patch, does the test suite still fail for you?
Comment 12 Garrett Regier 2015-05-04 22:16:17 UTC
Ping? This will bug will be closed shortly if there is no response.
Comment 13 Jasper Lievisse Adriaanse 2015-05-06 11:13:39 UTC
Sorry for the delay, but yes, libpeas 1.14.0 still fails for me:

libpeas:ERROR:extension-py.c:187:test_extension_py_mixed_python: stderr of child process (/extension/python/mixed-python/subprocess [13471]) failed to match:
FAIL
GTester: last random seed: R02Sf7166c911a7d9e7746200d2acf8fe452
Terminated
Makefile:962: recipe for target 'test' failed
gmake[4]: *** [test] Error 143
gmake[4]: Leaving directory '/usr/obj/ports/libpeas-1.14.0/libpeas-1.14.0/tests/libpeas'
Makefile:714: recipe for target 'test' failed
gmake[3]: *** [test] Error 1
gmake[3]: Leaving directory '/usr/obj/ports/libpeas-1.14.0/libpeas-1.14.0/tests'
Makefile:594: recipe for target 'check-am' failed
gmake[2]: *** [check-am] Error 2
gmake[2]: Leaving directory '/usr/obj/ports/libpeas-1.14.0/libpeas-1.14.0/tests'
Makefile:446: recipe for target 'check-recursive' failed
gmake[1]: *** [check-recursive] Error 1
gmake[1]: Leaving directory '/usr/obj/ports/libpeas-1.14.0/libpeas-1.14.0/tests'
Makefile:490: recipe for target 'check-recursive' failed
gmake: *** [check-recursive] Error 1
Comment 14 Garrett Regier 2015-05-06 21:35:41 UTC
Can you try running it with the patch I posted in comment #10? Otherwise I really can't debug this at all.
Comment 15 Garrett Regier 2015-05-12 12:07:39 UTC
Created attachment 303255 [details] [review]
Fix Python tests on OpenBSD

The OpenBSD linker spews warnings when a symbol has a different size. This was causing the stderr is empty assert to fail. Remove the assert and only inherit stderr when the PEAS_DEBUG environment variable is defined.


Example of the linker warnings:
./.libs/extension-python3:./.libs/libpython2.7.so.0.0: ./.libs/libpython3.4m.so.1.0 : WARNING: symbol(PyType_Type) size mismatch, relink your program
./.libs/extension-python3:./.libs/libpython2.7.so.0.0: ./.libs/libpython3.4m.so.1.0 : WARNING: symbol(PyBool_Type) size mismatch, relink your program
./.libs/extension-python3:./.libs/libpython2.7.so.0.0: ./.libs/libpython3.4m.so.1.0 : WARNING: symbol(PyCapsule_Type) size mismatch, relink your program
./.libs/extension-python3:./.libs/libpython2.7.so.0.0: ./.libs/libpython3.4m.so.1.0 : WARNING: symbol(PyEllipsis_Type) size mismatch, relink your program
Comment 16 Jasper Lievisse Adriaanse 2015-05-12 12:35:32 UTC
Thanks!
Comment 17 Ignacio Casal Quinteiro (nacho) 2015-05-14 10:40:00 UTC
Review of attachment 303255 [details] [review]:

ok
Comment 18 Garrett Regier 2015-05-14 10:54:48 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.