feat(webconnectivity@v0.5): probe and TH can't connect => website down (#957)

This diff introduces a special rule to avoid emitting null, null when all the connects failed in both the probe and the TH.

While there, recognize that the subset of null, null we're hunting actually deals with websites that are down, so change the internal naming to reflect that and make the code easier to read/understand.

See https://github.com/ooni/probe/issues/2299
This commit is contained in:
Simone Basso 2022-09-13 09:02:29 +02:00 committed by GitHub
commit 8d8554eb8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 17 deletions

View file

@ -72,7 +72,7 @@ type TestKeys struct {
// ControlFailure contains the failure of the control experiment.
ControlFailure *string `json:"control_failure"`
// DNSFlags contains DNS analysis flags.
// DNSFlags describes specific DNS anomalies we observed.
DNSFlags int64 `json:"x_dns_flags"`
// DNSExperimentFailure indicates whether there was a failure in any
@ -87,13 +87,11 @@ type TestKeys struct {
// the final HTTP request that we recorded.
HTTPExperimentFailure *string `json:"http_experiment_failure"`
// BlockingFlags contains blocking flags.
// BlockingFlags explains why we think that the website is blocked.
BlockingFlags int64 `json:"x_blocking_flags"`
// NullNullFlags explains why we determined that a measurement is not
// failed by detecting specific conditions that would have otherwise
// caused .Accessible = nil and .Blocking = nil
NullNullFlags int64 `json:"x_null_null_flags"`
// WebsiteDownFlags explains why we determined that the website is down.
WebsiteDownFlags int64 `json:"x_website_down_flags"`
// BodyLength match tells us whether the body length matches.
BodyLengthMatch *bool `json:"body_length_match"`
@ -339,7 +337,7 @@ func NewTestKeys() *TestKeys {
DNSConsistency: "",
HTTPExperimentFailure: nil,
BlockingFlags: 0,
NullNullFlags: 0,
WebsiteDownFlags: 0,
BodyLengthMatch: nil,
HeadersMatch: nil,
StatusCodeMatch: nil,