fix SEGV in agent/consul TestAutoEncryptSign/Works_with_defaults
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Overview of the Issue
https://github.com/hashicorp/consul/blob/87f32c8ba661760501e09b72078b0476d332a10d/agent/consul/auto_encrypt_endpoint_test.go#L20
Strangely enough this only seems to have a chance of breaking when running all of the agent/consul tests at once... could be shared state between them or some kind of resource starvation? Need to run it again w/ `make test-flake`.
#### Reproduction Steps
Test flake first occurred running the entire ./agent/consul suite
`gotestsum -f short-verbose -- ./agent/consul -timeout 0`
Running:
`gotestsum -f short-verbose -- ./agent/consul -run TestAutoEncryptSign/Works_with_defaults -timeout 0 -count 1000`
was not enough to get a fail. Need to try to repro with `make test-flake`
### Operating system and Environment details
macOS 10.14.6
### Log Fragments
Logs from local run:
```
=== RUN TestAutoEncryptSign/Works_with_defaults
2020/01/24 14:44:33 [DEBUG] serf: messageJoinType: TestClientServer_UserEvent-node-339
2020/01/24 14:44:33 [DEBUG] serf: messageJoinType: TestClientServer_UserEvent-node-339
2020/01/24 14:44:34 [DEBUG] serf: messageJoinType: TestClientServer_UserEvent-node-339
2020/01/24 14:44:34 [DEBUG] serf: messageJoinType: TestClientServer_UserEvent-node-339
2020/01/24 14:44:34 [DEBUG] serf: messageUserEventType: consul:new-leader
2020/01/24 14:44:34 [INFO] consul: New leader elected: TestClientServer_UserEvent-node-342
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x23cbd60]
goroutine 32614 [running]:
github.com/hashicorp/consul/agent/consul.testServerWithConfig.func1(0xc001f66660)
/Users/kitpatella/go/src/github.com/hashicorp/consul/agent/consul/server_test.go:224 +0x100
github.com/hashicorp/consul/sdk/testutil/retry.run.func2(0xc003c18c60, 0xc002a86000, 0xc001f66660)
/Users/kitpatella/go/src/github.com/hashicorp/consul/sdk/testutil/retry/retry.go:130 +0x56
created by github.com/hashicorp/consul/sdk/testutil/retry.run
/Users/kitpatella/go/src/github.com/hashicorp/consul/sdk/testutil/retry/retry.go:128 +0x120
FAIL github.com/hashicorp/consul/agent/consul 62.483s
FAIL agent/consul.TestAutoEncryptSign/Works_with_defaults (62.48s)
```
Contributor guide
Assessment
This issue has not been assessed yet.