File tree Expand file tree Collapse file tree 6 files changed +63
-11
lines changed
Expand file tree Collapse file tree 6 files changed +63
-11
lines changed Original file line number Diff line number Diff line change @@ -131,18 +131,17 @@ func UnitTestRunner(
131131 t .Cleanup (cancel )
132132
133133 wg .Add (1 )
134- go func () {
134+ wg . Go ( func () {
135135 t .Logf ("Starting command: %s" , args [0 ])
136136 defer t .Logf ("Command exited: %s" , args [0 ])
137- defer wg .Done ()
138- _ , err := cmd .ExecuteContextC (ctx )
139- err = connection .FilterStreamRPCError (err )
137+ _ , execErr := cmd .ExecuteContextC (ctx )
138+ execErr = connection .FilterStreamRPCError (execErr )
140139 if cmdTest .Err == nil {
141- assert .NoError (t , err )
142- } else if assert .Error (t , err ) {
143- assert .Equal (t , cmdTest .Err .Error (), err .Error ())
140+ assert .NoError (t , execErr )
141+ } else if assert .Error (t , execErr ) {
142+ assert .Equal (t , cmdTest .Err .Error (), execErr .Error ())
144143 }
145- }( )
144+ })
146145
147146 assert .Eventually (t , func () bool {
148147 return len (getMissing (cmdTest , cmdStdOut .String (), loggerPath )) == 0
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright IBM Corp. All Rights Reserved.
3+
4+ SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ package verifier
8+
9+ import (
10+ "testing"
11+
12+ "github.com/hyperledger/fabric-lib-go/bccsp/factory"
13+ )
14+
15+ func TestMain (m * testing.M ) {
16+ _ = factory .InitFactories (nil )
17+ m .Run ()
18+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright IBM Corp. All Rights Reserved.
3+
4+ SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ package policy
8+
9+ import (
10+ "testing"
11+
12+ "github.com/hyperledger/fabric-lib-go/bccsp/factory"
13+ )
14+
15+ func TestMain (m * testing.M ) {
16+ _ = factory .InitFactories (nil )
17+ m .Run ()
18+ }
Original file line number Diff line number Diff line change @@ -119,9 +119,6 @@ func TestParsePolicyItem(t *testing.T) {
119119func TestParseLifecycleEndorsementPolicy (t * testing.T ) {
120120 t .Parallel ()
121121
122- // Initialize factory before parallel subtests to avoid data race
123- require .NotNil (t , factory .GetDefault ())
124-
125122 t .Run ("valid bundle returns verifier" , func (t * testing.T ) {
126123 t .Parallel ()
127124 bundle , cryptoPath := createTestBundle (t )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "context"
1111
1212 "github.com/cockroachdb/errors"
13+ "github.com/hyperledger/fabric-lib-go/bccsp/factory"
1314 "github.com/hyperledger/fabric-lib-go/common/flogging"
1415 "github.com/hyperledger/fabric-x-common/api/committerpb"
1516 "golang.org/x/sync/errgroup"
4243// New instantiate a new VerifierServer.
4344func New (config * Config ) * Server {
4445 logger .Info ("Initializing new verifier server" )
46+ _ = factory .InitFactories (nil )
4547 return & Server {
4648 config : config ,
4749 metrics : newMonitoring (),
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright IBM Corp. All Rights Reserved.
3+
4+ SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ package signature
8+
9+ import (
10+ "testing"
11+
12+ "github.com/hyperledger/fabric-lib-go/bccsp/factory"
13+ )
14+
15+ func TestMain (m * testing.M ) {
16+ _ = factory .InitFactories (nil )
17+ m .Run ()
18+ }
You can’t perform that action at this time.
0 commit comments