Add tests for dns unreachable and fix hang#28
Conversation
|
Test running in Jenkins is really returning "none" ? Anybody knows why ? Mine returns "temperror", running on linux. Jenkins output: NVM: It was the cache |
|
I've found another hang, but It's hard to create a test and depend on real DNS. I will open another PR for you to review the solution, because I will add a class to simulate a real DNS. |
chibenwa
left a comment
There was a problem hiding this comment.
Thanks for the GREAT contribution, it looks awesome!
| System.out.println(result.getResult()); | ||
| System.out.println(result.getExplanation()); | ||
| System.out.println(result.getHeader()); |
There was a problem hiding this comment.
Maybe we can get rid of those System.out.println ?
| System.out.println(result.getResult()); | ||
| System.out.println(result.getExplanation()); | ||
| System.out.println(result.getHeader()); |
There was a problem hiding this comment.
In some tests like these, the details helps sometimes. Do you prefer I replace all these println with logger instead of remove them ?
There was a problem hiding this comment.
We could replace those with assertions so that the test reader get it in the source code of the test?
There was a problem hiding this comment.
Right. I will replace with assert the most relevant, and remove others.
|
(on a side note I would like to really thank you for your contributions to JSPF. Your help is much appreciated. |
Thank you :) |
The tests with hostname without dot are beign ignored.
When a PortUnreachableException or SocketException happens, a temperror should be returned.
This NPE happens when a PortUnreachableException (that doesn't have a message) is received in the exceptionally block, but other exceptions without a message also can trigger this bug. Also added the null check for e.getCause(), just in case.
Situations like a port unreachable should be considered a temperror by async executor, like the sync does.
|
Sorry for the force-push after the approval, but the commit "Fix tests hostname so they are not skipped" had an error, I didn't want it to be merged and have to create another fix after... |
chibenwa
left a comment
There was a problem hiding this comment.
No worry, the change set is rather small and still easy to understand (good commit history).
|
Hi ! |
|
Hello,
Please go ahead! |
No problem. Thanks ! |
This PR adds tests to reproduce DNS unreachable condition which causes a hang when async executor is in use, works flawlessly with sync.