From 37eba4b3028da9de7e6fb42557019f98bbda91b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 22 Feb 2024 11:35:07 +0100 Subject: [PATCH] test-nss-hosts: treat negative host lookup as slow The negative lookup can be quite slow. On my local network, skipping this test saves about half of the runtime of test-nss-hosts. --- src/test/test-nss-hosts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/test-nss-hosts.c b/src/test/test-nss-hosts.c index 7758f0adc98..72a9c6454c6 100644 --- a/src/test/test-nss-hosts.c +++ b/src/test/test-nss-hosts.c @@ -451,7 +451,11 @@ static int parse_argv(int argc, char **argv, } else { _cleanup_free_ char *hostname = NULL; assert_se(hostname = gethostname_malloc()); - assert_se(names = strv_new("localhost", "_gateway", "_outbound", "foo_no_such_host", hostname)); + assert_se(names = strv_new("localhost", + "_gateway", + "_outbound", + hostname, + slow_tests_enabled() ? "foo_no_such_host" : NULL)); n = make_addresses(&addrs); assert_se(n >= 0); -- 2.47.3