-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix overriding network config in tests #8756
Conversation
shared/params/network_config.go
Outdated
@@ -42,7 +42,7 @@ func BeaconNetworkConfig() *NetworkConfig { | |||
// OverrideBeaconNetworkConfig will override the network | |||
// config with the added argument. | |||
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) { | |||
networkConfig = cfg.Copy() | |||
networkConfig = cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your description it says it's only for tests but this is not used only for tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right... Now I am not so sure about the safety of this change. On the other hand this will align the network config's setup with the beacon config, so it doesn't look risky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the minimal we should test pyrmont or prater still works. Better see it breaking earlier than later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets leave it as it is, is there any reason a Copy
needs to be removed ?
Codecov Report
@@ Coverage Diff @@
## develop #8756 +/- ##
===========================================
+ Coverage 61.56% 61.63% +0.07%
===========================================
Files 509 509
Lines 34803 34803
===========================================
+ Hits 21426 21452 +26
+ Misses 10208 10177 -31
- Partials 3169 3174 +5 |
What type of PR is this?
Tests
What does this PR do? Why is it needed?
Overriding the network config in tests does not work properly. Config values are not being reset after the test, which may cause tests to fail if they're not in the correct order. The same issue does not occur for the beacon config.
This PR modifies the network config's setup to make it identical with the beacon config.
Which issues(s) does this PR fix?
N/A
Other notes for review
N/A