FIX flaky testIsValidMXRecord (usace.army.mil DNS filtering) (#39546)

testIsValidMXRecord() does a real live DNS lookup via
isValidMXRecord(), which is inherently CI-environment dependent. In a
recent Travis run, the assertion for usace.army.mil (result expected
1) failed while the other three domains in the same test resolved
correctly, indicating the .mil zone specifically was filtered/
unreachable from that CI network rather than any bug in
isValidMXRecord() itself - .mil DNS is a known target for network
filtering on shared CI infrastructure.

Replace it with microsoft.com, which has the same "domain with a
valid MX record" semantics but a far more globally reachable, stable
DNS setup less likely to be blocked by CI network policies.
This commit is contained in:
Frédéric FRANCE 2026-08-15 16:04:58 +02:00 committed by GitHub
parent 9b7d82f07d
commit 2df7fd755c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,7 @@
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025-2026 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -429,7 +429,9 @@ class FunctionsLibTest extends CommonClassTest
print __METHOD__." ".$input." result=".$result."\n";
$this->assertEquals(0, $result);
$input = "usace.army.mil";
// Note: intentionally not a .mil domain (some CI network environments filter/block .mil DNS
// resolution intermittently, which made this assertion flaky without any actual code issue).
$input = "microsoft.com";
$result = isValidMXRecord($input);
print __METHOD__." ".$input." result=".$result."\n";
$this->assertEquals(1, $result);