Skip to content

Commit

Permalink
[FAB-4087] Fix test failure in dockercontroller
Browse files Browse the repository at this point in the history
Test_Start test case is failing intermittently. Changed
code to assign the error returned by GetDeploymentPayload
function to a new variable.

Change-Id: I66715321c079939b9ffcae6edb974bc68ff728a5
Signed-off-by: Anil Ambati <aambati@us.ibm.com>
  • Loading branch information
Anil Ambati committed May 22, 2017
1 parent 5759ee4 commit 87ff9d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/container/dockercontroller/dockercontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (vm *DockerVM) Start(ctxt context.Context, ccid ccintf.CCID,
return err
}
} else {
dockerLogger.Errorf("start-could not recreate container %s", err)
dockerLogger.Errorf("start-could not recreate container: %s", err)
return err
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ func (vm *DockerVM) Start(ctxt context.Context, ccid ccintf.CCID,
// start container with HostConfig was deprecated since v1.10 and removed in v1.2
err = client.StartContainer(containerID, nil)
if err != nil {
dockerLogger.Errorf("start-could not start container %s", err)
dockerLogger.Errorf("start-could not start container: %s", err)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions core/container/dockercontroller/dockercontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func Test_Start(t *testing.T) {
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_GOLANG,
ChaincodeId: &pb.ChaincodeID{Name: "ex01", Path: chaincodePath},
Input: &pb.ChaincodeInput{Args: util.ToChaincodeArgs("f")}}
codePackage, err := platforms.GetDeploymentPayload(spec)
if err != nil {
codePackage, err1 := platforms.GetDeploymentPayload(spec)
if err1 != nil {
t.Fatal()
}
cds := &pb.ChaincodeDeploymentSpec{ChaincodeSpec: spec, CodePackage: codePackage}
Expand Down

0 comments on commit 87ff9d6

Please sign in to comment.