Skip to content

Commit

Permalink
Letting more time for the demo to timeout (#943)
Browse files Browse the repository at this point in the history
* Letting more time for the demo to timeout
* Adding some extra debug logs to the LocalOrchestration test
  • Loading branch information
AnomalRoil committed Mar 30, 2022
1 parent 22e77d2 commit 39a2752
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions demo/demo_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"fmt"
"os"
"testing"
"time"

Expand All @@ -15,30 +13,49 @@ import (

func TestLocalOrchestration(t *testing.T) {

// Let us have a 2 minutes deadline
// Let us have a 3 minutes deadline since the CI is slow
time.AfterFunc(
2*time.Minute,
3*time.Minute,
func() {
fmt.Println("Deadline reached")
os.Exit(1)
t.Fatal("[DEBUG]", "Deadline reached")
})

sch, beaconID := scheme.GetSchemeFromEnv(), common.GetBeaconIDFromEnv()

o := lib.NewOrchestrator(3, 2, "4s", true, "", false, sch, beaconID, true)
defer o.Shutdown()
t.Log("[DEBUG]", "[+] StartCurrentNodes")
o.StartCurrentNodes()

o.RunDKG("3")
o.WaitGenesis()

t.Log("[DEBUG]", "[+] WaitPeriod", 1)
o.WaitPeriod()

t.Log("[DEBUG]", "[+] CheckCurrentBeacon", 1)
o.CheckCurrentBeacon()
o.StopNodes(1)

t.Log("[DEBUG]", "[+] WaitPeriod", 2)
o.WaitPeriod()

t.Log("[DEBUG]", "[+] CheckCurrentBeacon", 2)
o.CheckCurrentBeacon(1)
o.StopNodes(2)

t.Log("[DEBUG]", "[+] WaitPeriod", 3)
o.WaitPeriod()

t.Log("[DEBUG]", "[+] WaitPeriod", 4)
o.WaitPeriod()
o.StartNode(1, 2)

t.Log("[DEBUG]", "[+] WaitPeriod", 5)
o.WaitPeriod()

t.Log("[DEBUG]", "[+] CheckCurrentBeacon", 3)
o.CheckCurrentBeacon()

t.Log("[DEBUG]", "[+] LocalOrchestration test finished, initiating shutdown")
}

0 comments on commit 39a2752

Please sign in to comment.