about summary refs log tree commit homepage
DateCommit message (Collapse)
2019-12-11build: support doc generation w/o GNU make
We can replace the GNU-isms for building docs with Perl5 equivalents. The only downside is the resulting Makefile gets larger, but that's the price of portability.
2019-12-11import: (cleanup) drop redundant env arg to run_die
run_die() doesn't require an $env arg, so there's no point passing "undef" to it.
2019-12-11spawn: remove support for clearing the env
It's unnecessary code which I'm not sure we ever used. In retrospect, completely clearing the environment doesn't make sense for the processes we spawn. We don't need to clobber individual environment variables in our code, either (and if we did for tests, we can use 'local').
2019-12-11tests: don't repeatly validate NEWS.atom
We can create a stamp to avoid rerunning the check unless NEWS.atom changes (and it will, soon, I hope :>).
2019-12-11TODO: update and add a few more items
SpamAssassin has used re2c (via sa-compile) for many years, now, and it seems to work fine, there. GMime also looks promising when combined with Inline::C since GMime can operate on mmap-ed regions. Given the inevitable demise of many .orgs when price rise; supporting a URL rewriter similar to .mailmap makes sense. And HTTP CONNECT seems like something our -httpd can support to let firewalled users read over NNTP.
2019-12-11ds: ->Reset initializes $nextq
I haven't noticed this being a problem in practice, but be consistent with the rest of the singleton stuff. Since we always call Reset() at load time, only do initialization in that sub and not at declaration.
2019-12-11t/common: set $0 when running script w/o fork
We can localize changes to $0 so $0 is restored when the "script" sub is done. This will be helpful when we encounter a stuck/slow processes during our tests (hopefully never!)
2019-12-11t: localize the PI_CONFIG env
We don't want the user's ~/.public-inbox/config to be read from during tests. I only noticed this because I had a non-existent pathname for one of my inboxes :x I've also verified this change by running "inotifywait ~/.public-inbox/config -m" in another terminal while running "make check"; (perhaps a portable solution could make it into the test suite).
2019-11-29replace: quiet "git gc" invocation
Since we give users no indication or control of how "git gc" runs, showing its progress is confusing.
2019-11-29t/replace: quiet "git fsck" invocation
Test output can be a terminal if running as "perl -I lib t/$FOO.t", and showing fsck progress is pointless for tests.
2019-11-28t/httpd-unix: FreeBSD expects to fail with EADDRINUSE
Tested FreeBSD 11.2. I'm starting to think I'm too conservative with this check and it could be safely expanded to cover any OS with UNIX sockets.
2019-11-27Makefile.PL: MANIFEST dependency fix
We need to force an update to Makefile (not Makefile.PL) when MANIFEST changes. Since "Makefile" (aka. "$(FIRST_MAKEFILE)") is already a single-colon make target; we can't create a double-colon rule to augment it. So we'll continue using a "Makefile.PL" rule, but have it recreate the resulting Makefile Finally, change the "check" target to use "prove -b" instead of "prove -l" so we test against "blib/lib", since what's in the "blib" dir will be installed. Fixes: 4c20de0694d06ff3 ("Makefile.PL: add dependency on MANIFEST contents")
2019-11-27httpd|nntpd: avoid missed signal wakeups
Our attempt at using a self-pipe in signal handlers was ineffective, since pure Perl code execution is deferred and Perl doesn't use an internal self-pipe/eventfd. In retrospect, I actually prefer the simplicity of Perl in this regard... We can use sigprocmask() from Perl, so we can introduce signalfd(2) and EVFILT_SIGNAL support on Linux and *BSD-based systems, respectively. These OS primitives allow us to avoid a race where Perl checks for signals right before epoll_wait() or kevent() puts the process to sleep. The (few) systems nowadays without signalfd(2) or IO::KQueue will now see wakeups every second to avoid missed signals.
2019-11-27dskqxs: fix missing EV_DISPATCH define
Oops, IO::KQueue support was broken due to this missing constant. Add a new ds-kqxs.t test case to ensure we test the IO::KQueue path if IO::KQueue is available.
2019-11-27msgtime: deal with strange minutes in TZ offsets
I'm not sure if TZ minute offsets aside from '00' or '30' exist, but lets just deal with them properly when negative. Examples taken from various inboxes on lore.kernel.org. These are mostly message from spammers, but some are legitimate messages.
2019-11-27t/msgtime: add more checks for known cases
Broken email clients sent the darndest things, make sure we can still support them when we make Date::Parse optional.
2019-11-27t/msgtime: show date in test descriptions
Otherwise it's hard to figure what fails.
2019-11-24tests: move giant inbox/git dependent tests to xt/
xt/ is typically reserved for "eXtended tests" intended for the maintainers and not ordinary users. Since these require special configuration and do nothing by waste cycles during startup, they qualify.
2019-11-24t/perf-*.t: use $ENV{GIANT_INBOX_DIR} consistently
It's more consistent with our current terminology and "PI_DIR" is already used to override ~/.public-inbox/ (which holds "config" and possibly other files which affect all inboxes for a particular user, but is not an inbox itself); so stop advertising GIANT_PI_DIR in skip messages.
2019-11-24tests: quiet down commit graph
Newer versions of git enable the commit graph by default. Since we blow away our temporary directories every test, generating graphis is a waste and clutters stderr with "Computing commit graph generation numbers" messages.
2019-11-24tests: use File::Temp->newdir instead of tempdir()
We'll also introduce a tmpdir() API to give tempdirs consistent names.
2019-11-24xapcmd: replace Xtmpdirs with File::Temp->newdir
Since we're using Perl 5.10.1 and File::Temp 0.19+, we don't need Xtmpdirs at all for cleaning up tempdirs on failure and can just rely on the DESTROY handler provided by File::Temp.
2019-11-24t/nntpd-validate: get rid of threads dependency
Threads are officially discouraged by perl5-porters and proves problematic with my Perl installation when using run_mode=1 to speed up tests. So just use fork() and pipes to share results from Net::NNTP.
2019-11-24t/common: start_script replaces spawn_listener
We can shave several hundred milliseconds off tests which spawn daemons by preloading and avoiding startup time for common modules which are already loaded in the parent process. This also gives ENV{TAIL} support to all tests which support daemons which log to stdout/stderr.
2019-11-24daemon: avoid race when quitting workers
While the master process has a self-pipe to avoid missing signals, worker processes lack that aside from a pipe to detect master death. That pipe doesn't exist when there's no master process, so it's possible DS::close never finishes because it never woke up from epoll_wait. So create a pipe on the worker_quit signal and force it into epoll/kevent so it wakes up right away.
2019-11-24daemon: use sigprocmask when respawning workers
We need to block signals in workers during respawns until they're ready to receive signals.
2019-11-24daemon: use sigprocmask to block signals at startup
`$SIG{FOO} = "IGNORE"' will cause the daemon to miss signals entirely. Instead, we can use sigprocmask to block signal delivery until we have our signal handlers setup. This closes a race where a PID file can be written for an init script and a signal to be dropped via "IGNORE".
2019-11-24.gitignore: ignore local prove(1) files
As described in prove(1), .prove is storage for --state=save and .proverc allows per-worktree customizations.
2019-11-24t/nntpd-tls: sometimes SSL_connect succeeds quickly
It seems caching can happen within OpenSSL or negotiation can be delayed in some cases. In any case, don't barf on PublicInbox::TLS::epollbit() when connect_SSL succeeds unexpectedly.
2019-11-24t/httpd-corner: wait for worker process death
We need to ensure the worker process is terminated before starting a new connection, so leave a persistent HTTP/1.1 connection open and wait for the SIGKILL to take effect and drop the client.
2019-11-24t/xcpdb-reshard: test xcpdb --compact
We did not have a test for this, and need to guard against regressions when changing Xapcmd to use File::Temp->newdir in future commits.
2019-11-24t/v1-add-remove-add: quiet down "git init"
Use the "-q" flag like everywhere else.
2019-11-24tests: use strict everywhere
The "strict" pragma makes code easier to debug, and we had undeclared variables as a result in t/watch_maildir_v2.t. So use it everywhere to be consistent with the rest of our code.
2019-11-24tests: disable daemon workers in a few more places
There were still a few places where we used worker processes unnecessarily in tests, causing a small amount of unnecessary overhead. Followup-to: ad221e9b2852f6c5 ("t/*.t: disable nntpd/httpd worker processes in most tests")
2019-11-24mboxgz: fix compiler parse error under under Perl 5.16.3
Perl 5.16.3 (and possibly older versions) fails with the following errors (from CentOS7): Use of ?PATTERN? without explicit operator is deprecated Search pattern not terminated
2019-11-24check for File::Temp 0.19 for ->newdir method
This is distributed with Perl 5.10.1 and onwards, so it should not be an installation burden for any users. I'm planning to move away from tempdir() entirely and use File::Temp->newdir to remove dependencies on END{} blocks.
2019-11-16t/xcpdb-reshard: use run_script for -xcpdb
This more than doubles the speed of the test, since we make many invocations of -xcpdb.
2019-11-16t/indexlevels-mirror*: switch to run_script
This more than doubles the speed of these tests
2019-11-16t/v2mda: switch to run_script in many places
This more than doubles the speed of the test.
2019-11-16t/watch_filter_rubylang: run_script for -init and -index
This nets us a 20% speedup or so.
2019-11-16t/nntpd: use run_script for -init
This only gives a 5% speedup or so, but anything helps.
2019-11-16t/watch_maildir_v2: use run_script for -init
This only gives a small 10% speedup or so, but anything helps.
2019-11-16t/httpd: use run_script for -init
This only gives a small ~10% speedup, since -httpd still needs execve, but any speedup is welcome.
2019-11-16t/convert-compact: convert to run_script
While this didn't use IPC::Run, having to reload several Perl modules and scripts is slow and inefficient, so roughly double the speed of this test.
2019-11-16t/v2mirror: switch to default run_mode for speedup
We need to be careful and explicitly close FDs before doing -index, since we can't rely on FD_CLOEXEC without execve(2) syscalls.
2019-11-16doc: remove IPC::Run as a dev and test dependency
It's no longer needed and we're able to speed up some of our tests as a result.
2019-11-16t/mda_filter_rubylang: drop IPC::Run dependency
This test runs more than twice as fast, now.
2019-11-16t/mda: switch to run_script for testing
Another noticeable speedup, this test is roughly ~3x faster now.
2019-11-16t/v2mirror: get rid of IPC::Run dependency
Not taking advantage of faster run modes in run_script, yet since some lifetime problems need to be sorted.
2019-11-16t/purge: convert to run_script
This nets us another sizeable speedup.