Skip to content

Commit e11280d

Browse files
committed
test
Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
1 parent 4c21c9b commit e11280d

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

integration/raft/cft_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() {
346346
Expect(err).NotTo(HaveOccurred())
347347

348348
By("Adding new ordering service node")
349-
time.Sleep(5 * time.Second)
349+
// time.Sleep(5 * time.Second)
350+
Eventually(ordererRunners[0].Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
350351
addConsenter(network, peer, orderers[0], "testchannel", &etcdraft.Consenter{
351352
ServerTlsCert: ordererCert,
352353
ClientTlsCert: ordererCert,
@@ -828,6 +829,9 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() {
828829

829830
By("submitting config updates to orderers with expired TLS certs to replace the expired certs")
830831
timeShift := 5 * time.Minute
832+
Eventually(o1Runner.Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
833+
Eventually(o2Runner.Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
834+
Eventually(o3Runner.Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
831835
for _, o := range orderers {
832836
channelConfig := fetchConfig(network, peer, o, nwo.ClusterPort, "testchannel", timeShift)
833837
c := conftx.New(channelConfig)
@@ -840,7 +844,7 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() {
840844
Expect(err).NotTo(HaveOccurred())
841845

842846
By("updating the config for " + o.Name)
843-
time.Sleep(5 * time.Second)
847+
// time.Sleep(5 * time.Second)
844848
updateOrdererConfig(network, o, nwo.ClusterPort, "testchannel", timeShift, c.OriginalConfig(), c.UpdatedConfig(), peer, o)
845849
}
846850

integration/raft/config_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() {
562562
port := network.OrdererPort(targetOrderer, nwo.ClusterPort)
563563

564564
fmt.Fprintf(GinkgoWriter, "Rotating certificate of orderer node %d\n", target+1)
565+
Eventually(ordererRunners[target].Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
565566
swap(submitterOrderer, rotation.oldCert, &etcdraft.Consenter{
566567
ServerTlsCert: rotation.newCert,
567568
ClientTlsCert: rotation.newCert,
@@ -613,13 +614,13 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() {
613614
}
614615

615616
By(fmt.Sprintf("Rotating cert on leader %d", leader))
616-
time.Sleep(5 * time.Second)
617+
// time.Sleep(5 * time.Second)
617618
rotate(leaderIndex)
618619

619620
By("Rotating certificates of other orderer nodes")
620621
for i := range certificateRotations {
621622
if i != leaderIndex {
622-
time.Sleep(5 * time.Second)
623+
// time.Sleep(5 * time.Second)
623624
rotate(i)
624625
}
625626
}
@@ -705,7 +706,8 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() {
705706
port := network.OrdererPort(o, nwo.ClusterPort)
706707

707708
By(fmt.Sprintf("Adding the future certificate of orderer node %d", i))
708-
time.Sleep(5 * time.Second)
709+
// time.Sleep(5 * time.Second)
710+
Eventually(ordererRunners[i].Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
709711
for _, channelName := range []string{"testchannel"} {
710712
addConsenter(network, peer, o, channelName, &etcdraft.Consenter{
711713
ServerTlsCert: rotation.newCert,
@@ -732,7 +734,8 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() {
732734
assertBlockReception(expectedBlockNumPerChannel[i*2], orderers, peer, network)
733735

734736
By("Removing the previous certificate of the old orderer")
735-
time.Sleep(5 * time.Second)
737+
// time.Sleep(5 * time.Second)
738+
Eventually(ordererRunner.Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
736739
for _, channelName := range []string{"testchannel"} {
737740
removeConsenter(network, peer, network.Orderers[(i+1)%len(network.Orderers)], channelName, rotation.oldCert)
738741
}
@@ -1154,7 +1157,8 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() {
11541157
Expect(err).To(Not(HaveOccurred()))
11551158

11561159
ordererEvicted1st := network.Orderers[(firstEvictedNode+1)%3]
1157-
time.Sleep(5 * time.Second)
1160+
// time.Sleep(5 * time.Second)
1161+
Eventually(ordererRunners[(firstEvictedNode+1)%3].Err(), network.EventuallyTimeout, time.Second).Should(gbytes.Say("store active nodes - "))
11581162
removeConsenter(network, peer, ordererEvicted1st, "testchannel", server1CertBytes)
11591163

11601164
var survivedOrdererRunners []*ginkgomon.Runner

orderer/consensus/etcdraft/chain.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ func (c *Chain) Consensus(req *orderer.ConsensusRequest, sender uint64) error {
535535

536536
c.Metrics.ActiveNodes.Set(float64(len(clusterMetadata.ActiveNodes)))
537537
c.ActiveNodes.Store(clusterMetadata.ActiveNodes)
538+
c.logger.Debugf("store active nodes - %d", len(clusterMetadata.ActiveNodes))
538539

539540
return nil
540541
}

0 commit comments

Comments
 (0)