Repository navigation
test(sweep): correct the DNS flag classifications - #701
Merged
Merged
Conversation
--no-dns and --dns were classified as sweep gaps. They are not: a sweep row gets spawn:dns-name only if the param file sets dns:/dns_name:, and spored skips registration without that tag — so sweeps never register DNS and there is nothing for --no-dns to disable. Found while verifying #549, which is fully fixed: --no-dns is wired, dns.enabled is read as a tri-state *bool (nil = inherit, so an absent key cannot disable DNS), and six pkg/config tests plus a cmd-level guard test cover every case the report raised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #549 as already fixed, with the verification — plus a correction to a classification I got wrong in #698 yesterday.
#549 is fully implemented
All three parts of the report are resolved:
1.
--no-dnsexists and is wired.cmd/launch_flags.go:330, passed intoLoadDNSConfigatcmd/launch_single.go:889, and the guard at:892skips registration with an explicit message. Its help text even addresses the reporter's specific complaint — that--wait-for-ssh=falsewas the only escape and also gave up the SSH wait:2.
dns.enabledis read.DNSConfig.IsEnabled()resolves it, andshouldAttemptDNSRegistrationconsults it.3. The tri-state concern is handled. The reporter noted that
Enabled boolhas no empty sentinel, so a config file present but silent ondns:would unmarshal tofalseand overwrite thetruedefault — "inert today, but it means the field can never express 'inherit' once something does read it." It is now*bool, withnilmeaning inherit:and the assignment is guarded on
fileConfig.DNS.Enabled != nil, with a comment stating that an absent key must not disable DNS.Six tests cover it, including the exact case raised:
TestLoadDNSConfig_ConfigFilePresentButSilentOnDNS_StillEnabled, plus tri-state resolution, flag-overrides-config, and the both-set case.shouldAttemptDNSRegistrationhas its own table test.The
defaults:residual is moot, and that's what I got wrongThe reporter's third smaller point was that
dnsisn't among the keyspkg/config/defaults.goaccepts. I classified--no-dnsand the--dns*flags as sweep gaps in #698 on that basis — reasoning that a benchmark fleet means a sweep, and a sweep could therefore neither pass--no-dnsnor set a default.That reasoning was wrong, and checking rather than assuming is what showed it: sweeps never register DNS in the first place.
config.DNSNameis set only when the param file providesdns:ordns_name:(cmd/sweep.go:282), and with nospawn:dns-nametag spored skips registration outright —pkg/agent/agent.go:266, "No DNS name configured → nothing to register."So on the sweep path the param file is the DNS route, and
--no-dnshas nothing to disable. These four flags aresweepNA, not gaps, and leaving them misclassified would have sent someone chasing a non-existent bug. Corrected here with the reason recorded.What this PR contains
Only the classification fix. The feature needed no work; I verified it instead of re-implementing it, which is the whole reason I went looking before writing code.
gofmt -lempty,go test -short ./cmd/ .green, the three manifest gates pass.