Skip to content

Commit 5b5e165

Browse files
authored
nwo: pass integration.WithRaceDetection flag to NWO to enable race detection (#1909)
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 0698378 commit 5b5e165

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

integration/token/fungible/dlogx/dlog_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ func newTestSuite(commType fsc.P2PCommunicationType, mask int, factor int, token
9191
})...)
9292
i.DeleteOnStart = true
9393
i.DeleteOnStop = false
94+
if integration.WithRaceDetection {
95+
i.EnableRaceDetector()
96+
}
9497
i.RegisterPlatformFactory(fabricx.NewPlatformFactory())
9598
i.RegisterPlatformFactory(token.NewPlatformFactory(i))
9699
i.Generate()

integration/token/test_utils.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,15 @@ func replicaName(name string, idx int) string {
116116
func NewTestSuite(startPort func() int, topologies []api.Topology) *TestSuite {
117117
return &TestSuite{
118118
generator: func() (*integration.Infrastructure, error) {
119-
return integration.New(startPort(), "", topologies...)
119+
i, err := integration.New(startPort(), "", topologies...)
120+
if err != nil {
121+
return i, err
122+
}
123+
if integration.WithRaceDetection {
124+
i.EnableRaceDetector()
125+
}
126+
127+
return i, nil
120128
},
121129
}
122130
}
@@ -131,6 +139,9 @@ func NewLocalTestSuite(startPort func() int, topologies []api.Topology) *TestSui
131139
return i, err
132140
}
133141
i.DeleteOnStop = false
142+
if integration.WithRaceDetection {
143+
i.EnableRaceDetector()
144+
}
134145

135146
return i, nil
136147
},

0 commit comments

Comments
 (0)