Skip to content

Commit

Permalink
FAB-4244 increase proposal wait time for tests
Browse files Browse the repository at this point in the history
Change-Id: I28a0b6c74e19efcf9c81b46f979ccbc2f07e8a8b
Signed-off-by: rickr <cr22rc@gmail.com>
  • Loading branch information
cr22rc committed May 30, 2017
1 parent d6c88da commit 1b72c0e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/test/java/org/hyperledger/fabric/sdk/testutils/TestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public class TestConfig {
private static final String GOSSIPWAITTIME = PROPBASE + "GossipWaitTime";
private static final String INVOKEWAITTIME = PROPBASE + "InvokeWaitTime";
private static final String DEPLOYWAITTIME = PROPBASE + "DeployWaitTime";
private static final String PROPOSALWAITTIME = PROPBASE + "ProposalWaitTime";


private static final String INTEGRATIONTESTS_ORG = PROPBASE + "integrationTests.org.";
private static final Pattern orgPat = Pattern.compile("^" + Pattern.quote(INTEGRATIONTESTS_ORG) + "([^\\.]+)\\.mspid$");
Expand Down Expand Up @@ -90,6 +92,8 @@ private TestConfig() {
defaultProperty(GOSSIPWAITTIME, "5000");
defaultProperty(INVOKEWAITTIME, "100000");
defaultProperty(DEPLOYWAITTIME, "120000");
defaultProperty(PROPOSALWAITTIME, "120000");


//////
defaultProperty(INTEGRATIONTESTS_ORG + "peerOrg1.mspid", "Org1MSP");
Expand Down Expand Up @@ -268,6 +272,15 @@ public int getGossipWaitTime() {
return Integer.parseInt(getProperty(GOSSIPWAITTIME));
}

/**
* Time to wait for proposal to complete
*
* @return
*/
public long getProposalWaitTime() {
return Integer.parseInt(getProperty(PROPOSALWAITTIME));
}

public Collection<SampleOrg> getIntegrationTestsSampleOrgs() {
return Collections.unmodifiableCollection(sampleOrgs.values());
}
Expand Down Expand Up @@ -369,4 +382,5 @@ private String getDomainName(final String name) {

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ void runChannel(HFClient client, Channel channel, SampleOrg sampleOrg, final int
////For GO language and serving just a single user, chaincodeSource is mostly likely the users GOPATH
installProposalRequest.setChaincodeSourceLocation(new File(TEST_FIXTURES_PATH + "/sdkintegration/gocc/sample_11"));
installProposalRequest.setChaincodeVersion(CHAIN_CODE_VERSION_11);
installProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());

out("Sending install proposal");

Expand Down Expand Up @@ -254,7 +255,7 @@ void runChannel(HFClient client, Channel channel, SampleOrg sampleOrg, final int

UpgradeProposalRequest upgradeProposalRequest = client.newUpgradeProposalRequest();
upgradeProposalRequest.setChaincodeID(chaincodeID_11);
upgradeProposalRequest.setProposalWaitTime(60000);
upgradeProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());
upgradeProposalRequest.setFcn("init");
upgradeProposalRequest.setArgs(new String[] {});// no arguments don't change the ledger see chaincode.

Expand Down Expand Up @@ -388,6 +389,7 @@ CompletableFuture<BlockEvent.TransactionEvent> moveAmount(HFClient client, Chann
transactionProposalRequest.setChaincodeID(chaincodeID);
transactionProposalRequest.setFcn("invoke");
transactionProposalRequest.setArgs(new String[] {"move", "a", "b", moveAmount});
transactionProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());
out("sending transaction proposal to all peers with arguments: move(a,b,%s)", moveAmount);

Collection<ProposalResponse> invokePropResp = channel.sendTransactionProposal(transactionProposalRequest, channel.getPeers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void runChannel(HFClient client, Channel channel, boolean installChaincode, Samp
///////////////
//// Instantiate chaincode.
InstantiateProposalRequest instantiateProposalRequest = client.newInstantiationProposalRequest();
instantiateProposalRequest.setProposalWaitTime(60000);
instantiateProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());
instantiateProposalRequest.setChaincodeID(chaincodeID);
instantiateProposalRequest.setFcn("init");
instantiateProposalRequest.setArgs(new String[] {"a", "500", "b", "" + (200 + delta)});
Expand Down Expand Up @@ -357,6 +357,7 @@ policy OR(Org1MSP.member, Org2MSP.member) meaning 1 signature from someone in ei
TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest();
transactionProposalRequest.setChaincodeID(chaincodeID);
transactionProposalRequest.setFcn("invoke");
transactionProposalRequest.setProposalWaitTime(testConfig.getProposalWaitTime());
transactionProposalRequest.setArgs(new String[] {"move", "a", "b", "100"});

Map<String, byte[]> tm2 = new HashMap<>();
Expand Down

0 comments on commit 1b72c0e

Please sign in to comment.