Skip to content

Commit 664facf

Browse files
juliancarrivick-ibmgaborh-da
authored andcommitted
Improve BDDTest decompose times
During BDDTests decomposing takes a lot longer than it should. This is due to the containers are started using `bash -c "<cmd>"` which does not pass on signals to the specified command. Hence, docker-compose sends a SIGTERM which is ignored and after a timeout, sends SIGKILL. Changing the invocations to `bash -c "exec <cmd>"` ensures the command receives the signals and terminates in a timely manner. This change improves BDDTest times by about 5 minutes. Change-Id: Id0504809740c948758f49ff08961cb377f0a8634 Signed-off-by: Julian Carrivick <[email protected]>
1 parent c9a0166 commit 664facf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

bddtests/compose-defaults.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ vp:
88
# Script will wait until membersrvc is up (if it exists) before starting
99
# $$GOPATH (double dollar) required to prevent docker-compose doing its own
1010
# substitution before the value gets to the container
11-
command: sh -c '$$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh'
11+
command: sh -c "exec $$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh"
1212

1313
# Use these options if coverage desired for peers
1414
#image: hyperledger/fabric-peer-coverage

bddtests/docker-compose-1-devmode.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vp0:
44
service: vp
55
environment:
66
- CORE_PEER_ID=vp0
7-
command: sh -c "peer node start --peer-chaincodedev"
7+
command: peer node start --peer-chaincodedev
88

99
ccenv:
1010
image: hyperledger/fabric-ccenv
@@ -13,6 +13,10 @@ ccenv:
1313
- CORE_PEER_ADDRESS=vp0:7051
1414
# $$GOPATH (double dollar) required to prevent docker-compose doing its own
1515
# substitution before the value gets to the container
16-
command: bash -c 'go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 && $$GOPATH/bin/chaincode_example02'
16+
command: |
17+
sh -c "
18+
go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
19+
exec $$GOPATH/bin/chaincode_example02
20+
"
1721
links:
1822
- vp0

bddtests/scripts/start-peer.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ else
1616
echo "No membersrvc to wait for, starting immediately"
1717
fi
1818

19-
peer node start
19+
exec peer node start
2020

0 commit comments

Comments
 (0)