unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: flub@devork.be
Subject: Adding config cache to notmuch_database_t breaks python-cffi test
Date: Sun, 20 Dec 2020 15:20:32 -0400	[thread overview]
Message-ID: <20201220192033.1361895-1-david@tethera.net> (raw)

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 =====================

             reply	other threads:[~2020-12-20 19:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 19:20 David Bremner [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201220192033.1361895-1-david@tethera.net \
    --to=david@tethera.net \
    --cc=flub@devork.be \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).