-
Notifications
You must be signed in to change notification settings - Fork 670
Compress recursive answers if they are too big. #1307
Conversation
Is it possible to write test for this that isn't horrific? |
Yeah I think I could probably put together a simple-but-slightly-contrived unit test. Let me have a go. |
Actually, there seems to be know way to use the golang dns resolver with your own server - its hard wired to read /etc/resolv.conf, and I don't think rewriting that in a unit test is a good idea. So we can have a test of the server side bits, but not the actual client error. |
544142c
to
a271cf4
Compare
5f02967
to
5763b6d
Compare
Note this doesn't test the golang resolver, where the original error was found, as I can't find a way to point the golang resolver at a custom dns server during a test. It does check that a compressed response from an upstream server is correctly handled.
5763b6d
to
67f9749
Compare
Hmm. 70 lines of test code for a 3 line change. I've fixed some minor niggles and re-based. @tomwilkie I see this is assigned to you - can I merge it? |
Yeah, test is a bit long. I can probably make it shorter with some aggressive refactoring. But I doubt its worth it. Go ahead, merge away. |
Compress recursive answers if they are too big. Fixes #1306.
Fixes #1306