Unverified Commit 9e9000a2 authored by Jay Guo's avatar Jay Guo Committed by Artem Barger
Browse files

[FAB-13934] Add GinkgoRecover to integration tests.



This makes assertion failure more debuggable.

Change-Id: I66f8ac8c9b755eaab37f89a10a39c3bfa44ef39a
Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
parent 942762e5
......@@ -381,7 +381,6 @@ func findLeader(ordererRunners []*ginkgomon.Runner) int {
wg.Add(len(ordererRunners))
findLeader := func(runner *ginkgomon.Runner) int {
defer GinkgoRecover()
Eventually(runner.Err(), time.Minute, time.Second).Should(gbytes.Say("Raft leader changed: 0 -> "))
idBuff := make([]byte, 1)
......@@ -396,7 +395,11 @@ func findLeader(ordererRunners []*ginkgomon.Runner) int {
for _, runner := range ordererRunners {
go func(runner *ginkgomon.Runner) {
defer wg.Done()
defer func() {
GinkgoRecover()
wg.Done()
}()
leader := findLeader(runner)
leaders <- leader
}(runner)
......
......@@ -540,7 +540,10 @@ func assertBlockReception(expectedHeightsPerChannel map[string]int, orderers []*
wg.Add(len(orderers))
for _, orderer := range orderers {
go func(orderer *nwo.Orderer) {
defer wg.Done()
defer func() {
GinkgoRecover()
wg.Done()
}()
waitForBlockReception(orderer, p, n, channelName, blockSeq)
}(orderer)
}
......@@ -552,7 +555,10 @@ func assertBlockReception(expectedHeightsPerChannel map[string]int, orderers []*
for channelName, blockSeq := range expectedHeightsPerChannel {
go func(channelName string, blockSeq int) {
defer wg.Done()
defer func() {
GinkgoRecover()
wg.Done()
}()
assertReception(channelName, blockSeq)
}(channelName, blockSeq)
}
......@@ -608,7 +614,10 @@ func assertNoErrorsAreLogged(ordererRunners []*ginkgomon.Runner) {
for _, runner := range ordererRunners {
go func(runner *ginkgomon.Runner) {
defer wg.Done()
defer func() {
GinkgoRecover()
wg.Done()
}()
assertNoErrors(runner)
}(runner)
}
......@@ -624,7 +633,10 @@ func deployChaincodes(n *nwo.Network, p *nwo.Peer, o *nwo.Orderer, mycc nwo.Chai
"testchannel3": mycc3,
} {
go func(channel string, cc nwo.Chaincode) {
defer wg.Done()
defer func() {
GinkgoRecover()
wg.Done()
}()
nwo.DeployChaincode(n, channel, o, cc, p)
}(channel, chaincode)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment