Fwd: Bug#876306: gnucash FTBFS: object class 'Transaction' has no property named 'bogus'

Micha Lenk micha at lenk.info
Wed Sep 27 03:44:29 EDT 2017

Dear Gnucash developers,

The following bug has been reported in the Debian bug tracker as

I agree that Gnucash tests shouldn't test the behavior of GObject.
Please consider to drop this test.

Best regards,

----- Forwarded message from Steve Langasek <steve.langasek at canonical.com> -----

Date: Wed, 20 Sep 2017 12:12:16 -0700
From: Steve Langasek <steve.langasek at canonical.com>
To: submit at bugs.debian.org
Subject: Bug#876306: gnucash FTBFS: object class 'Transaction' has no property named 'bogus'

Package: gnucash
Version: 1:2.6.17-1
Severity: serious
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Hi Dmitry,

The gnucash package has been failing to build in Ubuntu with a test failure,
and I have reproduced this failure in Debian unstable:

  /engine/Transaction/xaccTransScrubGainsDate_gains_dirty:             **
ERROR:utest-Transaction.c:452:test_gnc_transaction_set_get_property: assertion failed (check1->hits == 1): (0 == 1)
<INFO> (gnc.engine) [xaccSplitEqualCheckBal] balances differ: 100000/1000 vs 200000/1000
<FATAL WARNING> (GLib-GObject) g_object_set_is_valid_property: object class 'Transaction' has no property named 'bogus'
<FATAL WARNING> (GLib-GObject) g_object_set_is_valid_property: object class 'Transaction' has no property named 'bogus'
  /engine/Transaction/gnc transaction set/get property:                FAIL
GTester: last random seed: R02Sa8a1794f6622116b0a513984cbbbcc0f
Makefile:1926: recipe for target 'test-nonrecursive' failed
make[7]: *** [test-nonrecursive] Terminated


This looks like a brittle test that has broken as a result of implementation
details in gobject; I don't see any reason why the gnucash test suite should
be testing the specific text of the error message returned by gobject when
performing a disallowed operation.  The gnucash implementation never relies
on the contents of this error string anywhere else, and it's not the
business of the gnucash testsuite to be testing the behavior of gobject
instead of its own.

So I think this particular test (or this aspect of the test) should be
dropped.  But in the meantime, here is a patch that fixes the test failure
on Debian and Ubuntu.

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org

diff -Nru gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch
--- gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch	1969-12-31 16:00:00.000000000 -0800
+++ gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch	2017-09-20 11:43:37.000000000 -0700
@@ -0,0 +1,31 @@
+Description: fix test case to work with newer gobject
+ glib 2.54 changes the error string returned by a particular wrong call
+ to g_object_set().  gnucash's testsuite relies on matching the exact
+ text of this error string.  This is a wrong thing for the testsuite to do
+ - nothing in gnucash outside of the testsuite relies on this behavior, and
+ it's testing behavior of glib not of gnucash - but for the moment, here is
+ a patch that updates the expected string to match current glib.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Index: gnucash-2.6.17/src/engine/test/utest-Transaction.c
+--- gnucash-2.6.17.orig/src/engine/test/utest-Transaction.c
++++ gnucash-2.6.17/src/engine/test/utest-Transaction.c
+@@ -412,7 +412,7 @@
+                           "GNR", "", 240), *t_curr = NULL;
+     Timespec now = timespec_now (), *t_entered = NULL, *t_posted = NULL;
+     time_t secs = (time_t)now.tv_sec;
+-    gchar *msg1 = "g_object_set_valist: object class " _Q "Transaction' has no property named " _Q "bogus'";
++    gchar *msg1 = "g_object_set_is_valid_property: object class " _Q "Transaction' has no property named " _Q "bogus'";
+     gchar *msg2 = g_strdup_printf ("[xaccTransSetDateInternal] addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s",
+                                    txn, now.tv_sec, now.tv_nsec, ctime (&secs));
+     GLogLevelFlags loglevel1 = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
+@@ -453,7 +453,7 @@
+     g_assert_cmpint (check2->hits, ==, 2);
+     g_free (check1->msg);
+-    check1->msg = g_strdup ("g_object_get_valist: object class " _Q "Transaction' has no property named " _Q "bogus'");
++    check1->msg = g_strdup ("g_object_get_is_valid_property: object class " _Q "Transaction' has no property named " _Q "bogus'");
+     g_object_get (G_OBJECT (txn),
+                   "num", &t_num,
+                   "description", &t_desc,
diff -Nru gnucash-2.6.17/debian/patches/series gnucash-2.6.17/debian/patches/series
--- gnucash-2.6.17/debian/patches/series	2016-12-21 13:24:42.000000000 -0800
+++ gnucash-2.6.17/debian/patches/series	2017-09-20 11:19:43.000000000 -0700
@@ -1 +1,2 @@

----- End forwarded message -----

More information about the gnucash-devel mailing list