Skip to content

Commit 87ff9d6

Browse files
author
Anil Ambati
committed
[FAB-4087] Fix test failure in dockercontroller
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 <[email protected]>
1 parent 5759ee4 commit 87ff9d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/container/dockercontroller/dockercontroller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (vm *DockerVM) Start(ctxt context.Context, ccid ccintf.CCID,
253253
return err
254254
}
255255
} else {
256-
dockerLogger.Errorf("start-could not recreate container %s", err)
256+
dockerLogger.Errorf("start-could not recreate container: %s", err)
257257
return err
258258
}
259259
}
@@ -329,7 +329,7 @@ func (vm *DockerVM) Start(ctxt context.Context, ccid ccintf.CCID,
329329
// start container with HostConfig was deprecated since v1.10 and removed in v1.2
330330
err = client.StartContainer(containerID, nil)
331331
if err != nil {
332-
dockerLogger.Errorf("start-could not start container %s", err)
332+
dockerLogger.Errorf("start-could not start container: %s", err)
333333
return err
334334
}
335335

core/container/dockercontroller/dockercontroller_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func Test_Start(t *testing.T) {
125125
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_GOLANG,
126126
ChaincodeId: &pb.ChaincodeID{Name: "ex01", Path: chaincodePath},
127127
Input: &pb.ChaincodeInput{Args: util.ToChaincodeArgs("f")}}
128-
codePackage, err := platforms.GetDeploymentPayload(spec)
129-
if err != nil {
128+
codePackage, err1 := platforms.GetDeploymentPayload(spec)
129+
if err1 != nil {
130130
t.Fatal()
131131
}
132132
cds := &pb.ChaincodeDeploymentSpec{ChaincodeSpec: spec, CodePackage: codePackage}

0 commit comments

Comments
 (0)