-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: avoid race access to config.Version by tests
Network server constructor reads config.Version variable, and testcli.DeployContract writes dummy config.Version which causes race in tests. Avoid this race by moving config.Version initialisation to a separate package and perform it inside test packages init(). Close #3011, close #3017. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
- Loading branch information
1 parent
91c928e
commit eeb439f
Showing
8 changed files
with
34 additions
and
35 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
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package versionutil | ||
|
||
import "github.com/nspcc-dev/neo-go/pkg/config" | ||
|
||
// TestVersion is a NeoGo version that should be used to keep all | ||
// compiled NEFs the same from run to run for tests. | ||
const TestVersion = "0.90.0-test" | ||
|
||
// init sets config.Version to a dummy TestVersion value to keep contract NEFs | ||
// consistent between test runs for those packages who import it. For test usage | ||
// only! | ||
func init() { | ||
config.Version = TestVersion | ||
} |
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