Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Observed this segfault running all tests on mater, occurring in around 2-3 out of 10 test runs. ``` FAIL: //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10) (see /home/j/.cache/bazel/_bazel_j/1ba834ca9d49f27aeb8f0bbb6f28fdf3/execroot/prysm/bazel-out/k8-fastbuild/testlogs/beacon-chain/sync/go_default_test/shard_3_of_4_run_1_of_10/test.log) INFO: From Testing //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10): ==================== Test output for //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10): panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x138eea6] goroutine 1660 [running]: github.com/prysmaticlabs/prysm/shared/abool.(*AtomicBool).IsSet(...) shared/abool/abool.go:39 github.com/prysmaticlabs/prysm/beacon-chain/sync.(*Service).subscribeStaticWithSubnets.func1(0xc002dd4400, 0xc002990940, 0x17bca26, 0x1e) beacon-chain/sync/subscriber.go:207 +0xe6 created by github.com/prysmaticlabs/prysm/beacon-chain/sync.(*Service).subscribeStaticWithSubnets beacon-chain/sync/subscriber.go:200 +0x172 ================================================================================ ``` TestStaticSubnets was testing a Service with an uninitialized chainStarted value. This commit initializes chainStarted explicitly in all tests that construct a Service. This reduces the observed flake rate to 0/10 runs. This was verified with: ``` ./bazel.sh test //beacon-chain/sync:go_default_test --runs_per_test 10 ```
- Loading branch information