Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit d665653

Browse files
Increase timeout for chaincode install
Chaincode install using lifecycle was timing out, both at the peer and client SDK. Changed CORE_CHAINCODE_EXECUTETIMEOUT in peer docker configuration and explicitly set a longer client side timeout on the call to Client.sendLifecycleInstallChaincodeRequest(). Change-Id: I00e7c051d38d8129c45229cc5c9d7c3bce378da7 Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
1 parent 8af3374 commit d665653

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/test/fixture/sdkintegration/peer-base/peer-base.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
- CORE_PEER_GOSSIP_ORGLEADER=false
1717
- CORE_PEER_CHANNELSERVICE_ENABLED=true
1818
- CORE_CHAINCODE_STARTUPTIMEOUT=10m # only cause our vms are so slow!
19+
- CORE_CHAINCODE_EXECUTETIMEOUT=300s # Allow more time for chaincode container to build on install
1920
# The following setting skips the gossip handshake since we are
2021
# are not doing mutual TLS
2122
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/msp

src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private TestConfig() {
132132
// Default values
133133

134134
defaultProperty(INVOKEWAITTIME, "32000");
135-
defaultProperty(DEPLOYWAITTIME, "120000");
135+
defaultProperty(DEPLOYWAITTIME, "300000");
136136
defaultProperty(PROPOSALWAITTIME, "120000");
137137
defaultProperty(RUNIDEMIXMTTEST, "false");
138138
defaultProperty(RUNSERVICEDISCOVERYIT, "false");

src/test/java/org/hyperledger/fabric/sdkintegration/End2endLifecycleIT.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
import java.util.concurrent.TimeUnit;
2828
import java.util.concurrent.TimeoutException;
2929
import java.util.function.Predicate;
30-
import java.util.stream.Collectors;
3130

3231
import com.google.protobuf.InvalidProtocolBufferException;
33-
import org.hyperledger.fabric.protos.peer.lifecycle.Lifecycle;
3432
import org.hyperledger.fabric.sdk.BlockEvent.TransactionEvent;
3533
import org.hyperledger.fabric.sdk.ChaincodeCollectionConfiguration;
3634
import org.hyperledger.fabric.sdk.ChaincodeResponse;
@@ -346,8 +344,8 @@ void runChannel(HFClient org1Client, Channel org1Channel, SampleOrg org1, Collec
346344
final String chaincodeLabel = lifecycleChaincodePackage.getLabel();
347345
final Type chaincodeType = lifecycleChaincodePackage.getType();
348346

349-
//Org1 installs the chaincode on it's peers.
350-
out("Org1 installs the chaincode on it's peers.");
347+
//Org1 installs the chaincode on its peers.
348+
out("Org1 installs the chaincode on its peers.");
351349
String org1ChaincodePackageID = lifecycleInstallChaincode(org1Client, org1MyPeers, lifecycleChaincodePackage);
352350
assertTrue(org1ChaincodePackageID.contains(chaincodeLabel)); // the packageId should have the label in it so you have some idea what it is.
353351

@@ -411,8 +409,8 @@ void runChannel(HFClient org1Client, Channel org1Channel, SampleOrg org1, Collec
411409

412410
org2Client.setUserContext(org2.getPeerAdmin());
413411

414-
//Org2 installs the chaincode on it's peers
415-
out("Org2 installs the chaincode on it's peers.");
412+
//Org2 installs the chaincode on its peers
413+
out("Org2 installs the chaincode on its peers.");
416414
String org2ChaincodePackageID = lifecycleInstallChaincode(org2Client, org2MyPeers, org2LifecycleChaincodePackage);
417415

418416
//Sanity check to see if chaincode really is on it's peers and has the hash as expected.
@@ -515,6 +513,7 @@ private String lifecycleInstallChaincode(HFClient client, Collection<Peer> peers
515513

516514
LifecycleInstallChaincodeRequest installProposalRequest = client.newLifecycleInstallChaincodeRequest();
517515
installProposalRequest.setLifecycleChaincodePackage(lifecycleChaincodePackage);
516+
installProposalRequest.setProposalWaitTime(DEPLOYWAITTIME);
518517

519518
Collection<LifecycleInstallChaincodeProposalResponse> responses = client.sendLifecycleInstallChaincodeRequest(installProposalRequest, peers);
520519
assertNotNull(responses);

0 commit comments

Comments
 (0)