Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7eeacbd35 |
+4
-3
@@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
DNS is never mocked in this project, not in tests and not anywhere
|
DNS is never mocked in this project, not in tests and not anywhere
|
||||||
else; see the README section "No DNS mocking. Ever." Every test that
|
else; see the README section "No DNS mocking. Ever." Every test that
|
||||||
involves DNS **MUST** use live queries against real DNS servers: the
|
looks something up in DNS **MUST** query live DNS servers, never a
|
||||||
resolver's tests, and the tests of code that uses the resolver, such
|
stand-in. Logic that works on record data, such as comparing or
|
||||||
as the watcher.
|
formatting records, may be tested on that data directly with no
|
||||||
|
lookup.
|
||||||
|
|
||||||
### Rationale
|
### Rationale
|
||||||
|
|
||||||
|
|||||||
@@ -528,8 +528,10 @@ func TestQueryNameserverIP_Timeout(t *testing.T) {
|
|||||||
r := newTestResolver(t)
|
r := newTestResolver(t)
|
||||||
|
|
||||||
// Nothing answers at 192.0.2.1, a documentation address. The
|
// Nothing answers at 192.0.2.1, a documentation address. The
|
||||||
// deadline must outlast one query timeout (two seconds): a query
|
// resolver tries each query twice; if the deadline has passed
|
||||||
// cut short by the deadline itself is not reported as a timeout.
|
// before the second try starts, the query is reported as nodata,
|
||||||
|
// not timeout. So the deadline must outlast the first try's
|
||||||
|
// two-second timeout.
|
||||||
ctx, cancel := context.WithTimeout(
|
ctx, cancel := context.WithTimeout(
|
||||||
context.Background(), 3*time.Second,
|
context.Background(), 3*time.Second,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user