Skip to content

Commit

Permalink
Improve BDDTest decompose times
Browse files Browse the repository at this point in the history
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 <cjulian@au1.ibm.com>
  • Loading branch information
juliancarrivick-ibm authored and gaborh-da committed Aug 17, 2016
1 parent c9a0166 commit 664facf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bddtests/compose-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vp:
# Script will wait until membersrvc is up (if it exists) before starting
# $$GOPATH (double dollar) required to prevent docker-compose doing its own
# substitution before the value gets to the container
command: sh -c '$$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh'
command: sh -c "exec $$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh"

# Use these options if coverage desired for peers
#image: hyperledger/fabric-peer-coverage
Expand Down
8 changes: 6 additions & 2 deletions bddtests/docker-compose-1-devmode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vp0:
service: vp
environment:
- CORE_PEER_ID=vp0
command: sh -c "peer node start --peer-chaincodedev"
command: peer node start --peer-chaincodedev

ccenv:
image: hyperledger/fabric-ccenv
Expand All @@ -13,6 +13,10 @@ ccenv:
- CORE_PEER_ADDRESS=vp0:7051
# $$GOPATH (double dollar) required to prevent docker-compose doing its own
# substitution before the value gets to the container
command: bash -c 'go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 && $$GOPATH/bin/chaincode_example02'
command: |
sh -c "
go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
exec $$GOPATH/bin/chaincode_example02
"
links:
- vp0
2 changes: 1 addition & 1 deletion bddtests/scripts/start-peer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ else
echo "No membersrvc to wait for, starting immediately"
fi

peer node start
exec peer node start

0 comments on commit 664facf

Please sign in to comment.