Skip to content

Commit

Permalink
fix gateway integration tests error (hyperledger#4584)
Browse files Browse the repository at this point in the history
Signed-off-by: Fedor Partanskiy <pfi79@mail.ru>
  • Loading branch information
pfi79 authored Dec 25, 2023
1 parent 073b570 commit 4201eb5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration/devmode/devmode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func ApproveChaincodeForMyOrg(n *nwo.Network, channel string, orderer *nwo.Order
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
ClientAuth: n.ClientAuthRequired,
WaitForEventTimeout: n.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0))
Expand Down
4 changes: 4 additions & 0 deletions integration/e2e/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ var _ = Describe("EndToEndACL", func() {
ChannelConfigPolicy: chaincode.ChannelConfigPolicy,
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit())
Expand All @@ -166,6 +167,7 @@ var _ = Describe("EndToEndACL", func() {
ChannelConfigPolicy: chaincode.ChannelConfigPolicy,
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit())
Expand All @@ -192,6 +194,7 @@ var _ = Describe("EndToEndACL", func() {
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
PeerAddresses: []string{network.PeerAddress(org1Peer0, nwo.ListenPort)},
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit())
Expand Down Expand Up @@ -279,6 +282,7 @@ var _ = Describe("EndToEndACL", func() {
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
PeerAddresses: peerAddresses,
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit())
Expand Down
1 change: 1 addition & 0 deletions integration/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ var _ = Describe("EndToEnd", func() {
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
ClientAuth: network.ClientAuthRequired,
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess.Err, network.EventuallyTimeout).Should(gbytes.Say(`Error: proposal failed with status: 500`))
Expand Down
9 changes: 9 additions & 0 deletions integration/nwo/commands/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ type ChaincodeApproveForMyOrg struct {
PeerAddresses []string
WaitForEvent bool
ClientAuth bool
WaitForEventTimeout time.Duration
}

func (c ChaincodeApproveForMyOrg) SessionName() string {
Expand Down Expand Up @@ -367,6 +368,10 @@ func (c ChaincodeApproveForMyOrg) Args() []string {
args = append(args, "--peerAddresses", p)
}

if c.WaitForEventTimeout > 30*time.Second {
args = append(args, "--waitForEventTimeout", c.WaitForEventTimeout.String())
}

return args
}

Expand Down Expand Up @@ -471,6 +476,7 @@ type ChaincodeCommit struct {
PeerAddresses []string
WaitForEvent bool
ClientAuth bool
WaitForEventTimeout time.Duration
}

func (c ChaincodeCommit) SessionName() string {
Expand Down Expand Up @@ -502,6 +508,9 @@ func (c ChaincodeCommit) Args() []string {
if c.ClientAuth {
args = append(args, "--clientauth")
}
if c.WaitForEventTimeout > 30*time.Second {
args = append(args, "--waitForEventTimeout", c.WaitForEventTimeout.String())
}
return args
}

Expand Down
2 changes: 2 additions & 0 deletions integration/nwo/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func ApproveChaincodeForMyOrg(n *Network, channel string, orderer *Orderer, chai
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
ClientAuth: n.ClientAuthRequired,
WaitForEventTimeout: n.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0))
Expand Down Expand Up @@ -238,6 +239,7 @@ func CommitChaincode(n *Network, channel string, orderer *Orderer, chaincode Cha
CollectionsConfig: chaincode.CollectionsConfig,
PeerAddresses: peerAddresses,
ClientAuth: n.ClientAuthRequired,
WaitForEventTimeout: n.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0))
Expand Down
1 change: 1 addition & 0 deletions integration/pvtdata/pvtdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ func approveChaincodeForMyOrgExpectErr(n *nwo.Network, orderer *nwo.Orderer, cha
ChannelConfigPolicy: chaincode.ChannelConfigPolicy,
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
WaitForEventTimeout: n.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit())
Expand Down
1 change: 1 addition & 0 deletions integration/smartbft/smartbft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ var _ = Describe("EndToEnd Smart BFT configuration test", func() {
InitRequired: chaincode.InitRequired,
CollectionsConfig: chaincode.CollectionsConfig,
ClientAuth: network.ClientAuthRequired,
WaitForEventTimeout: network.EventuallyTimeout,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit(0))
Expand Down

0 comments on commit 4201eb5

Please sign in to comment.