Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
From: Dan Callaghan <noreply@github.com>
To: djc@djc.id.au,  sup-commits@supmua.dev
Subject: [sup-heliotrope/sup] 6a5717: tests: avoid leaking index writes from TestIndex
Date: Sun, 05 Apr 2026 21:11:44 -0700	[thread overview]
Message-ID: <sup-heliotrope/sup/push/refs/heads/develop/2837f0-ad657e@github.com> (raw)

  Branch: refs/heads/develop
  Home:   https://github.com/sup-heliotrope/sup
  Commit: 6a5717ce15cb23dbe7ddfe3db74b6f63d22034db
      https://github.com/sup-heliotrope/sup/commit/6a5717ce15cb23dbe7ddfe3db74b6f63d22034db
  Author: Dan Callaghan <djc@djc.id.au>
  Date:   2026-04-06 (Mon, 06 Apr 2026)

  Changed paths:
    M test/unit/test_index.rb

  Log Message:
  -----------
  tests: avoid leaking index writes from TestIndex

Fixes a randomly occurring test failure:

    Finished in 5.187590s, 16.9636 runs/s, 74.4083 assertions/s.

      1) Failure:
    TestSupSyncBackMaildir#test_it_syncs_seen_unread_flags [/home/runner/work/sup/sup/test/integration/test_sup-sync-back-maildir.rb:36]:
    Expected true to not be truthy.

    88 runs, 386 assertions, 1 failures, 0 errors, 0 skips

Reproducible using:

    nix-shell contrib/nix/ruby2.6-shell.nix --run 'rake test TESTOPTS=--seed=29609'

Bisected to commit b49dcfe7dd25100feb88ed8aefe629fd91423a26.

It seems Dir.mktmpdir is aggressively reusing temp directory names(!)
which in itself would be fine, since each test cleans up its temp
directory in teardown. But it seems that the newly added TestIndex was
leaving the Xapian database open and Xapian may write to it even after
the test teardown has finished... apparently re-creating the cleaned-up
temp directory in the process(!).

Since we have no way to explicitly close or destroy the index, the best
we can do is to explicitly flush it before removing the temp directory
so that it will not try to write again later.


  Commit: ad657e383d6914c053b7cceff082c05c096d0245
      https://github.com/sup-heliotrope/sup/commit/ad657e383d6914c053b7cceff082c05c096d0245
  Author: Dan Callaghan <djc@djc.id.au>
  Date:   2026-04-06 (Mon, 06 Apr 2026)

  Changed paths:
    M lib/sup/message_chunks.rb

  Log Message:
  -----------
  delete unused Tempfile monkey-patch for Ruby < 1.8.7

Ruby 2.0+ has been required since commit cce594e35 so this is dead code.


Compare: https://github.com/sup-heliotrope/sup/compare/2837f0614381...ad657e383d69

To unsubscribe from these emails, change your notification settings at https://github.com/sup-heliotrope/sup/settings/notifications

                 reply	other threads:[~2026-04-06  4:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=sup-heliotrope/sup/push/refs/heads/develop/2837f0-ad657e@github.com \
    --to=noreply@github.com \
    --cc=djc@djc.id.au \
    --cc=sup-commits@supmua.dev \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox