GNOME Bugzilla – Bug 727380
Add error messages on OpenBSD to test log hooks
Last modified: 2015-05-14 10:54:48 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?
Created attachment 273329 [details] [review] Add error messages on OpenBSD to test log hooks
Ping?
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?
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?
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'*'
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
Created attachment 289816 [details] [review] Bug 727380 - Fix test suite to work on OpenBSD v2 Forgot about the ignored warnings in testing-utils.
Created attachment 290242 [details] [review] Bug 727380 - Fix test suite to work on OpenBSD v2 Updated to apply to current git master
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
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
I committed an updated version of the patch, does the test suite still fail for you?
Ping? This will bug will be closed shortly if there is no response.
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
Can you try running it with the patch I posted in comment #10? Otherwise I really can't debug this at all.
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
Thanks!
Review of attachment 303255 [details] [review]: ok
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.