BIND 10 #3265: DNSClientTest.sendReceive due to the timeout test

BIND 10 Development do-not-reply at isc.org
Sat Dec 14 06:13:42 UTC 2013


#3265: DNSClientTest.sendReceive due to the timeout test
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:
  jinmei                             |                Status:  new
                       Type:         |             Milestone:  New Tasks
  defect                             |              Keywords:
                   Priority:         |             Sensitive:  0
  medium                             |           Sub-Project:  DNS
                  Component:  dhcp-  |  Estimated Difficulty:  0
  ddns                               |           Total Hours:  0
               CVSS Scoring:         |
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 Until recently DNSClientTest.sendReceive (under src/bin/d2/tests)
 intermittently failed for me.  One easiest way to reproduce it is to
 repeat a sequence of DNSClientTest.timeout then sendReceive until we
 see the first failure:

 {{{
 % while true; do
 ./d2_unittests
 --gtest_filter=DNSClientTest.timeout:DNSClientTest.sendReceive || break
 done
 }}}

 Eventually (not so long, normally within a few seconds), we see:

 {{{
 [ RUN      ] DNSClientTest.sendReceive
 dns_client_unittests.cc:116: Failure
 Value of: status_
   Actual: 1
 Expected: DNSClient::SUCCESS
 Which is: 0
 dns_client_unittests.cc:119: Failure
 Value of: response_->getQRFlag()
   Actual: 0
 Expected: D2UpdateMessage::RESPONSE
 Which is: 1
 dns_client_unittests.cc:121: Failure
 Value of: response_->getRRCount(D2UpdateMessage::SECTION_ZONE)
   Actual: 0
 Expected: 1
 [  FAILED  ] DNSClientTest.sendReceive (6 ms)
 }}}

 This was because the sendReceive starts before the packet sent by the
 timeout test was dropped in the kernel, and the response is sent to
 the wrong port.

 A recent commit at fe99fae754429d42ff01dc01d79fe7b5495beaad mitigated
 it by increasing the timeout value from 0 to 500ms:

 {{{#!diff
          // Set the response wait time to 0 so as our test is not hanging.
 This
          // should cause instant timeout.
 -        const int timeout = 0;
 +        const int timeout = 500;
 }}}
 (the commit log didn't talk about it at all, so I don't know the
 reason for the change)

 but, although this may be sufficient in practice, it doesn't
 completely eliminate the root cause.  So I'd suggest either

 - using a different port for the timeout test (less preferably), or
 - make sure the packet from the timeout test is received (and dropped)
   by the test itself

 Even if you don't like to do either of them, the above comment line
 should be corrected: the wait time is not 0 anymore.

-- 
Ticket URL: <http://bind10.isc.org/ticket/3265>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list