When shutdown cancels a check that is under way, the rest of the check runs on with the cancelled context. The resolver already drops a lookup the context cut short. Port and TLS checks did not: the cancelled connection attempt was saved as a closed port or a failed certificate check, and notified as Port Change or TLS Failure.
checkSinglePort and checkTLSCert return without saving or notifying when the context was cancelled by the time the check returns, the way the resolver's queryEachNS drops a cut-short query.
README shutdown step says so.
TestCancelledCheckSavesNothing saves a hostname at 127.0.0.1 with both ports open and a good certificate, then runs a check with the context already cancelled, using the real resolver and the real port and TLS checkers. It fails if either of the two new checks is removed.
Not shown by the diff:
A result is dropped whenever the context was cancelled by the time the check returned, even a success, as the resolver does. The next start checks again.
Disclosures:
Deviation from the plan: the test cancels the context before the check, not during a connection, and starts no local listener. The watcher checks only ports 80 and 443 and looks up DNS first, so a cancel mid-connection needs live DNS or new test hooks; the watcher code under test is the same.
Judgement call: one test covers the port and the TLS check, since one check runs both; it fails with either half of the fix removed.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/dnswatcher/issues/185.
When shutdown cancels a check that is under way, the rest of the check runs on with the cancelled context. The resolver already drops a lookup the context cut short. Port and TLS checks did not: the cancelled connection attempt was saved as a closed port or a failed certificate check, and notified as `Port Change` or `TLS Failure`.
- `checkSinglePort` and `checkTLSCert` return without saving or notifying when the context was cancelled by the time the check returns, the way the resolver's `queryEachNS` drops a cut-short query.
- README shutdown step says so.
`TestCancelledCheckSavesNothing` saves a hostname at `127.0.0.1` with both ports open and a good certificate, then runs a check with the context already cancelled, using the real resolver and the real port and TLS checkers. It fails if either of the two new checks is removed.
Not shown by the diff:
- A result is dropped whenever the context was cancelled by the time the check returned, even a success, as the resolver does. The next start checks again.
Disclosures:
- Deviation from the plan: the test cancels the context before the check, not during a connection, and starts no local listener. The watcher checks only ports 80 and 443 and looks up DNS first, so a cancel mid-connection needs live DNS or new test hooks; the watcher code under test is the same.
- Judgement call: one test covers the port and the TLS check, since one check runs both; it fails with either half of the fix removed.
Model: opus-5-5
When shutdown cancels a check that is under way, the rest of the check
still runs with the cancelled context. The resolver already drops a
lookup the context cut short, but a cancelled connection attempt was
saved as a closed port or a failed certificate check and notified as
Port Change or TLS Failure. The watcher now drops a port or TLS check
result when its context was cancelled, the same way. The test runs a
check with the context already cancelled, using the real resolver and
the real port and TLS checkers; no query is sent and no connection is
made.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #185.
When shutdown cancels a check that is under way, the rest of the check runs on with the cancelled context. The resolver already drops a lookup the context cut short. Port and TLS checks did not: the cancelled connection attempt was saved as a closed port or a failed certificate check, and notified as
Port ChangeorTLS Failure.checkSinglePortandcheckTLSCertreturn without saving or notifying when the context was cancelled by the time the check returns, the way the resolver'squeryEachNSdrops a cut-short query.TestCancelledCheckSavesNothingsaves a hostname at127.0.0.1with both ports open and a good certificate, then runs a check with the context already cancelled, using the real resolver and the real port and TLS checkers. It fails if either of the two new checks is removed.Not shown by the diff:
Disclosures:
Model: opus-5-5
Review passed on
a860dd6.Model: opus-5-5