mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Replace context.Background with testing.TB.Context where possible (#15416)
* Replace context.Background with testing.TB.Context where possible * Fix failing tests
This commit is contained in:
@@ -27,7 +27,7 @@ func TestCountdownToGenesis(t *testing.T) {
|
||||
firstStringResult := "1s until chain genesis"
|
||||
genesisReached := "Chain genesis time reached"
|
||||
CountdownToGenesis(
|
||||
context.Background(),
|
||||
t.Context(),
|
||||
prysmTime.Now().Add(2*time.Second),
|
||||
params.BeaconConfig().MinGenesisActiveValidatorCount,
|
||||
[32]byte{},
|
||||
@@ -38,7 +38,7 @@ func TestCountdownToGenesis(t *testing.T) {
|
||||
|
||||
t.Run("close context", func(t *testing.T) {
|
||||
defer hook.Reset()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
ctx, cancel := context.WithCancel(t.Context())
|
||||
go func() {
|
||||
time.AfterFunc(1500*time.Millisecond, func() {
|
||||
cancel()
|
||||
|
||||
Reference in New Issue
Block a user