feat(oonimkall): instrument code to understand CI issue (#518)

* feat(oonimkall): instrument code to understand CI issue

It seems ~difficult to reproduce the problem locally and I could not
see it after five runs of

```
go test -race -count 1 ./pkg/oonimkall/...
```

So, here's some diagnostic code that could help understanding the
reference issue https://github.com/ooni/probe/issues/1785.

Also, it seems the issue pops up much more frequently when running
CI anyway. So, I am going to leave this diff around and when it
appears again I have more context to fix the issue.

* fix(oonimkall): skip flaky test in short mode

See https://github.com/ooni/probe/issues/1785
This commit is contained in:
Simone Basso 2021-09-28 13:41:41 +02:00 committed by GitHub
parent 6d3a4f1db8
commit 1fd2b1fd53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,10 @@ func TestMeasurementSubmissionFailure(t *testing.T) {
} }
func TestRunnerMaybeLookupLocationFailure(t *testing.T) { func TestRunnerMaybeLookupLocationFailure(t *testing.T) {
if testing.Short() {
// TODO(https://github.com/ooni/probe-cli/pull/518)
t.Skip("skip test in short mode")
}
out := make(chan *Event) out := make(chan *Event)
settings := &Settings{ settings := &Settings{
AssetsDir: "../../testdata/oonimkall/assets", AssetsDir: "../../testdata/oonimkall/assets",
@ -54,7 +58,7 @@ func TestRunnerMaybeLookupLocationFailure(t *testing.T) {
} }
case "status.queued", "status.started", "status.end": case "status.queued", "status.started", "status.end":
default: default:
panic(fmt.Sprintf("unexpected key: %s", ev.Key)) panic(fmt.Sprintf("unexpected key: %s - %+v", ev.Key, ev.Value))
} }
} }
seench <- seen seench <- seen