Skip to content

Commit

Permalink
TestChaincodeInvokeChaincode intermittent fail ppc64le
Browse files Browse the repository at this point in the history
The core/chaincode package fails intermittently on ppc64le
while running the TestChaincodeInvokeChaincode test. This is
due to peer/node/start_test.go using the same filesystem path,
running in parallel, and removing the directory, often  before
TestChaincodeInvokeChaincode has had time to complete.

FAB-11727 #done

Change-Id: Ib07d9d2eae76bc1623515ef4242f94534f911b91
Signed-off-by: Will Lahti <[email protected]>
  • Loading branch information
wlahti committed Aug 29, 2018
1 parent e41ad23 commit 2ed5537
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions peer/node/start_test.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
/*
Copyright 2017 Hitachi America, Ltd.
Copyright Hitachi America, Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/

package node

import (
"bytes"
"io/ioutil"
"os"
"testing"

Expand All @@ -32,22 +23,23 @@ import (

func TestStartCmd(t *testing.T) {
defer viper.Reset()

g := NewGomegaWithT(t)

tempDir, err := ioutil.TempDir("", "startcmd")
g.Expect(err).NotTo(HaveOccurred())
defer os.RemoveAll(tempDir)

viper.Set("peer.address", "localhost:6051")
viper.Set("peer.listenAddress", "0.0.0.0:6051")
viper.Set("peer.chaincodeListenAddress", "0.0.0.0:6052")
viper.Set("peer.fileSystemPath", "/tmp/hyperledger/test")
viper.Set("peer.fileSystemPath", tempDir)
viper.Set("chaincode.executetimeout", "30s")
viper.Set("chaincode.mode", "dev")
overrideLogModules := []string{"msp", "gossip", "ledger", "cauthdsl", "policies", "grpc"}
for _, module := range overrideLogModules {
viper.Set("logging."+module, "INFO")
}

defer os.RemoveAll("/tmp/hyperledger/test")

msptesttools.LoadMSPSetupForTesting()

go func() {
Expand Down

0 comments on commit 2ed5537

Please sign in to comment.