OSDN Git Service

Increase the DNS TTL to 5s to fix netd_test.
authorPierre Imai <imaipi@google.com>
Fri, 13 May 2016 07:28:28 +0000 (16:28 +0900)
committerPierre Imai <imaipi@google.com>
Fri, 13 May 2016 07:35:59 +0000 (16:35 +0900)
Under some rare, but repeatable, conditions, the cache would expire
before the second getaddrinfo() call in the test was executed, thus causing
superfluous queries that made the test fail. Increasing the TTL fixes
this.

BUG: 28252032

Change-Id: I82919c147ca9c1b7a92f963556b27fb72e3d2222

tests/dns_responder.cpp

index 4b77b62..6094ca1 100644 (file)
@@ -802,7 +802,7 @@ bool DNSResponder::addAnswerRecords(const DNSQuestion& question,
     record.name = question.qname;
     record.rtype = question.qtype;
     record.rclass = ns_class::ns_c_in;
-    record.ttl = 1;
+    record.ttl = 5;  // seconds
     if (question.qtype == ns_type::ns_t_a) {
         record.rdata.resize(4);
         if (inet_pton(AF_INET, it->second.c_str(), record.rdata.data()) != 1) {