Skip to content

Commit

Permalink
Add nil check to test
Browse files Browse the repository at this point in the history
I've seen the following flaky error in CI:
```
panic: runtime error: invalid memory address or nil pointer dereference
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1209 +0x24e
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1212 +0x218
/opt/hostedtoolcache/go/1.17.5/x64/src/runtime/panic.go:1038 +0x215
/runner/_work/celo-blockchain/celo-blockchain/core/types/block.go:487 +0x30
/runner/_work/celo-blockchain/celo-blockchain/e2e_test/e2e_test.go:573 +0x56a
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1259 +0x102
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1306 +0x35a
```

I don't think it is caused by this PR, adding a nil check to make the
error case clearer can't hurt.
  • Loading branch information
karlb committed Jun 7, 2023
1 parent 04776fe commit 545fabf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions e2e_test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ func TestEthersJSCompatibility(t *testing.T) {
err = network[0].Tracker.AwaitBlock(ctx, num+1)
require.NoError(t, err)
block := network[0].Tracker.GetProcessedBlock(num)
require.NotNil(t, block)

// Prune state
err = pruneStateOfBlock(ctx, network[0], block.Hash())
Expand Down

0 comments on commit 545fabf

Please sign in to comment.