-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update TestMain(): do not call os.Exit() explicitly (#8046)
* update workspace * update testmain
- Loading branch information
Showing
20 changed files
with
126 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
package cache | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/prysmaticlabs/prysm/shared/featureconfig" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
run := func() int { | ||
resetCfg := featureconfig.InitWithReset(&featureconfig.Flags{EnableEth1DataVoteCache: true}) | ||
defer resetCfg() | ||
return m.Run() | ||
} | ||
os.Exit(run()) | ||
resetCfg := featureconfig.InitWithReset(&featureconfig.Flags{EnableEth1DataVoteCache: true}) | ||
defer resetCfg() | ||
m.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
package spectest | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/prysmaticlabs/prysm/shared/params" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
run := func() int { | ||
prevConfig := params.BeaconConfig().Copy() | ||
defer params.OverrideBeaconConfig(prevConfig) | ||
c := params.BeaconConfig() | ||
c.MinGenesisActiveValidatorCount = 16384 | ||
params.OverrideBeaconConfig(c) | ||
prevConfig := params.BeaconConfig().Copy() | ||
defer params.OverrideBeaconConfig(prevConfig) | ||
c := params.BeaconConfig() | ||
c.MinGenesisActiveValidatorCount = 16384 | ||
params.OverrideBeaconConfig(c) | ||
|
||
return m.Run() | ||
} | ||
os.Exit(run()) | ||
m.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
package beacon | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/prysmaticlabs/prysm/beacon-chain/flags" | ||
"github.com/prysmaticlabs/prysm/shared/params" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
run := func() int { | ||
// Use minimal config to reduce test setup time. | ||
prevConfig := params.BeaconConfig().Copy() | ||
defer params.OverrideBeaconConfig(prevConfig) | ||
params.OverrideBeaconConfig(params.MinimalSpecConfig()) | ||
// Use minimal config to reduce test setup time. | ||
prevConfig := params.BeaconConfig().Copy() | ||
defer params.OverrideBeaconConfig(prevConfig) | ||
params.OverrideBeaconConfig(params.MinimalSpecConfig()) | ||
|
||
resetFlags := flags.Get() | ||
flags.Init(&flags.GlobalFlags{ | ||
MinimumSyncPeers: 30, | ||
}) | ||
defer func() { | ||
flags.Init(resetFlags) | ||
}() | ||
resetFlags := flags.Get() | ||
flags.Init(&flags.GlobalFlags{ | ||
MinimumSyncPeers: 30, | ||
}) | ||
defer func() { | ||
flags.Init(resetFlags) | ||
}() | ||
|
||
return m.Run() | ||
} | ||
os.Exit(run()) | ||
m.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
package stateutil_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/prysmaticlabs/prysm/shared/featureconfig" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
run := func() int { | ||
resetCfg := featureconfig.InitWithReset(&featureconfig.Flags{EnableSSZCache: true}) | ||
defer resetCfg() | ||
return m.Run() | ||
} | ||
os.Exit(run()) | ||
resetCfg := featureconfig.InitWithReset(&featureconfig.Flags{EnableSSZCache: true}) | ||
defer resetCfg() | ||
m.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.