unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Adding config cache to notmuch_database_t breaks python-cffi test
@ 2020-12-20 19:20 David Bremner
  2020-12-20 19:20 ` [PATCH] lib: cache configuration information from database David Bremner
  2020-12-20 21:03 ` Adding config cache to notmuch_database_t breaks python-cffi test David Bremner
  0 siblings, 2 replies; 5+ messages in thread
From: David Bremner @ 2020-12-20 19:20 UTC (permalink / raw)
  To: notmuch; +Cc: flub

I hope Floris (or someone) can tell me what is going on here, I don't
understand the memory management in the CFFI bindings very well.

As part of my attempt to remodel config handling, I've added a cache
for the configuration information stored in the database. This doesn't
seem to break any other tests, and valgrind doesn't spot any memory
errors.

Here's the output from pytest

______________________________ TestIter.test_del _______________________________

self = <test_config.TestIter object at 0x7f21c50a0cd0>
db = Database(path=/tmp/pytest-of-bremner/pytest-50/test_del0, mode=Mode.READ_WRITE)

    def test_del(self, db):
        db.config['spam'] = 'ham'
        assert db.config.get('spam') == 'ham'
        del db.config['spam']
>       assert db.config.get('spam') is None
E       AssertionError: assert 'ham' is None
E        +  where 'ham' = <bound method Mapping.get of <notmuch2._config.ConfigMapping object at 0x7f21c50a0af0>>('spam')
E        +    where <bound method Mapping.get of <notmuch2._config.ConfigMapping object at 0x7f21c50a0af0>> = <notmuch2._config.ConfigMapping object at 0x7f21c50a0af0>.get
E        +      where <notmuch2._config.ConfigMapping object at 0x7f21c50a0af0> = Database(path=/tmp/pytest-of-bremner/pytest-50/test_del0, mode=Mode.READ_WRITE).config

tests/test_config.py:56: AssertionError
=========================== short test summary info ============================
FAILED tests/test_config.py::TestIter::test_del - AssertionError: assert 'ham...
==================== 1 failed, 155 passed in 29.25 seconds =====================

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-24 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-20 19:20 Adding config cache to notmuch_database_t breaks python-cffi test David Bremner
2020-12-20 19:20 ` [PATCH] lib: cache configuration information from database David Bremner
2020-12-20 21:03 ` Adding config cache to notmuch_database_t breaks python-cffi test David Bremner
2020-12-20 23:22   ` David Bremner
2020-12-24 16:05     ` Floris Bruynooghe

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).