From 0774c93ae638ac8e486d857544e16e37281cdb48 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 17 Jun 2025 22:00:34 +0200 Subject: [PATCH] tests: make rspamd not block on dns queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These will never suceed while running the tests in the Nix sandbox, and skipping them leads to very noticable (~51%) speedups. Before: ``` Benchmark 1: nix build .#hydraJobs.x86_64-linux.external-unstable --rebuild Time (mean ± σ): 151.737 s ± 1.074 s [User: 0.310 s, System: 0.289 s] Range (min … max): 150.321 s … 153.512 s 10 runs ``` After: ``` Benchmark 1: nix build .#hydraJobs.x86_64-linux.external-unstable --rebuild Time (mean ± σ): 74.010 s ± 0.746 s [User: 0.269 s, System: 0.266 s] Range (min … max): 72.814 s … 75.190 s 10 runs ``` --- tests/lib/config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/lib/config.nix b/tests/lib/config.nix index 6708f50..f13f15a 100644 --- a/tests/lib/config.nix +++ b/tests/lib/config.nix @@ -9,4 +9,13 @@ # Enable second CPU core virtualisation.cores = lib.mkDefault 2; + + # Don't make tests block on DNS requests that will never succeed + services.rspamd.locals."options.inc".text = '' + dns { + nameservers = ["127.0.0.1"]; + timeout = 0.0s; + retransmits = 0; + } + ''; }