From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AIWrBiak31+qRAAA0tVLHw (envelope-from ) for ; Sun, 20 Dec 2020 19:21:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sFmAAiak318bMgAA1q6Kng (envelope-from ) for ; Sun, 20 Dec 2020 19:21:10 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 576FE9403C5 for ; Sun, 20 Dec 2020 19:21:09 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 41ED728C8F; Sun, 20 Dec 2020 14:21:00 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 867A32852F for ; Sun, 20 Dec 2020 14:20:57 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id AA18F5FC36; Sun, 20 Dec 2020 14:20:55 -0500 (EST) Received: (nullmailer pid 1392047 invoked by uid 1000); Sun, 20 Dec 2020 19:20:53 -0000 From: David Bremner 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 Message-Id: <20201220192033.1361895-1-david@tethera.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Message-ID-Hash: JC5CZR4XFQ2L6B7JJW7QXJY5PXYRDATB X-Message-ID-Hash: JC5CZR4XFQ2L6B7JJW7QXJY5PXYRDATB X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.66 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 576FE9403C5 X-Spam-Score: 0.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: yXMW3H+Lh5CF 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 = 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' = >('spam') E + where > = .get E + where = 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 =====================