Skip to content

Commit

Permalink
[FAB-11065] Fix panic in integration test
Browse files Browse the repository at this point in the history
Change-Id: I313da39f7ced675e4ab863ca0982ee4815bafb76
Signed-off-by: Bob Stasyszyn <[email protected]>
  • Loading branch information
bstasyszyn committed Jul 5, 2018
1 parent a2264e7 commit 5af6829
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/integration/orgs/multiple_orgs_minconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func discoverPeers(t *testing.T, sdk *fabsdk.FabricSDK) []fab.Peer {
t.Logf("%d- [%s] - MSP [%s]", i, p.URL(), p.MSPID())
}
if len(peers) < expectedPeers {
return nil, status.New(status.TestStatus, status.GenericTransient.ToInt32(), err.Error(), nil)
return nil, status.New(status.TestStatus, status.GenericTransient.ToInt32(), "didn't get expected number of peers", nil)
}
return peers, nil
},
Expand Down
6 changes: 4 additions & 2 deletions test/integration/orgs/multiple_orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func verifyErrorFromCC(chClientOrg1User *channel.Client, t *testing.T, ccName st
}

func queryInstalledCC(t *testing.T, orgID string, resMgmt *resmgmt.Client, ccName, ccVersion string, peers []fab.Peer) bool {
installed, _ := retry.NewInvoker(retry.New(retry.TestRetryOpts)).Invoke(
installed, err := retry.NewInvoker(retry.New(retry.TestRetryOpts)).Invoke(
func() (interface{}, error) {
ok := isCCInstalled(t, orgID, resMgmt, ccName, ccVersion, peers)
if !ok {
Expand All @@ -446,6 +446,7 @@ func queryInstalledCC(t *testing.T, orgID string, resMgmt *resmgmt.Client, ccNam
},
)

require.NoErrorf(t, err, "Got error checking if chaincode was installed")
return *(installed).(*bool)
}

Expand Down Expand Up @@ -477,7 +478,7 @@ func queryInstantiatedCC(t *testing.T, orgID string, resMgmt *resmgmt.Client, ch
require.Truef(t, len(peers) > 0, "Expecting one or more peers")
t.Logf("Querying [%s] peers to see if chaincode [%s] was instantiated on channel [%s]", orgID, ccName, channelID)

instantiated, _ := retry.NewInvoker(retry.New(retry.TestRetryOpts)).Invoke(
instantiated, err := retry.NewInvoker(retry.New(retry.TestRetryOpts)).Invoke(
func() (interface{}, error) {
ok := isCCInstantiated(t, resMgmt, channelID, ccName, ccVersion, peers)
if !ok {
Expand All @@ -486,6 +487,7 @@ func queryInstantiatedCC(t *testing.T, orgID string, resMgmt *resmgmt.Client, ch
return &ok, nil
},
)
require.NoErrorf(t, err, "Got error checking if chaincode was instantiated")
return *(instantiated).(*bool)
}

Expand Down

0 comments on commit 5af6829

Please sign in to comment.