Compat: run them from a copy, and keep our listeners out of the way

Rehearsed the run against a real RocksDB store, and it died at startup
before checking anything: the harness inserts listeners of its own, the
registry keys them by name, and a real server already has a "jmap" and an
"imap". The message was "Primary key conflict on property name with
existing object NetworkListener", which says nothing about what to do.
Under NO_INSERT the harness now calls its listeners compat-jmap and so on,
and the same run gets through to the test's own checks.

run-compat.sh copies the store for each test and removes the copy after,
because several of these write to what they open: monitoring_compat purges
the history it reads and undelete_compat restores what it finds. The source
stays untouched, which matters when it is the only copy of a production
store anyone took that day.

INBUXA runs RocksDB, so a copy is a directory copy. The SQL backends would
need more than this: the harness builds its own container and connects to
fixed local credentials, so it cannot open a dump in place.
This commit is contained in:
2026-09-19 20:21:05 -07:00
parent d407509f59
commit 1da75e986e
4 changed files with 135 additions and 1 deletions
+13 -1
View File
@@ -200,11 +200,23 @@ impl TestServerBuilder {
if protocol == NetworkListenerProtocol::Http {
self.http_listener_port = port;
}
// inbuxa: with NO_INSERT the store is a copy of a real server's, and
// that server has listeners of its own. A production one called
// "jmap" or "imap" would collide with ours on the name, which is the
// registry's primary key, and every compat test would die here
// before it checked anything. Namespace ours out of its way.
// The copy must still be pristine: a second run over a copy the
// first one wrote to collides with `compat-` instead.
let name = if std::env::var("NO_INSERT").is_ok() {
format!("compat-{name}")
} else {
name.to_string()
};
self.insert_object(NetworkListener {
bind: Map::new(vec![
SocketAddr::from_str(&format!("0.0.0.0:{port}")).unwrap(),
]),
name: name.to_string(),
name,
protocol,
use_tls: true,
tls_implicit,