Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gateway integration tests #4584

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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