Skip to content

Conversation

@juaninf
Copy link
Contributor

@juaninf juaninf commented Nov 13, 2025

The test testUnknownHost was failing in some computers presumably due DNS hijacking, or other DNS mechanism. We tried to fixing this issue by replacing .com by .invalid in this-host-should-not-exist.com. The TLD .invalid is reserved by RFC 6761 and guaranteed to do not resolve.

@juaninf juaninf requested a review from ic0ns November 13, 2025 05:54
@ic0ns
Copy link
Contributor

ic0ns commented Nov 13, 2025

[ERROR] Tests run: 15, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.366 s <<< FAILURE! -- in de.rub.nds.crawler.data.ScanTargetTest
[ERROR] de.rub.nds.crawler.data.ScanTargetTest.testUnknownHost -- Time elapsed: 0.013 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <UNRESOLVABLE> but was: <TO_BE_EXECUTED>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
	at de.rub.nds.crawler.data.ScanTargetTest.testUnknownHost(ScanTargetTest.java:148)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

@juaninf juaninf changed the title Use .invalid TLD which is reserved by RFC 6761 and guaranteed to nev… Add DNS resolver abstraction and mock for testable hostname resolution Nov 21, 2025
@juaninf
Copy link
Contributor Author

juaninf commented Nov 21, 2025

As @ic0ns was pointing out even with .invalid there were still errors for DNS resolution. Then, we added a DNS resolver abstraction and mock for testable hostname resolution.

@ic0ns ic0ns merged commit fbe59f6 into main Nov 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants