github.com/smartcontractkit/chainlink-terra@v0.1.4/tests/e2e/chaos/chaos_test.go (about)

     1  package chaos
     2  
     3  import (
     4  	"time"
     5  
     6  	. "github.com/onsi/ginkgo/v2"
     7  	. "github.com/onsi/gomega"
     8  	"github.com/smartcontractkit/chainlink-terra/tests/e2e/smoke/common"
     9  	"github.com/smartcontractkit/integrations-framework/actions"
    10  )
    11  
    12  var _ = Describe("Terra chaos suite", func() {
    13  	var state = &common.OCRv2State{}
    14  	BeforeEach(func() {
    15  		By("Deploying OCRv2 cluster", func() {
    16  			state.DeployCluster(5, true)
    17  			state.LabelChaosGroups()
    18  			state.SetAllAdapterResponsesToTheSameValue(2)
    19  		})
    20  	})
    21  	It("Can tolerate chaos experiments", func() {
    22  		By("Stable and working", func() {
    23  			state.ValidateRoundsAfter(time.Now(), 10, false)
    24  		})
    25  		By("Can work with faulty nodes offline", func() {
    26  			state.CanWorkWithFaultyNodesOffline()
    27  		})
    28  		By("Can't work with two parts network split, restored after", func() {
    29  			state.RestoredAfterNetworkSplit()
    30  		})
    31  		By("Can recover from yellow group loss connection to validator", func() {
    32  			state.CanWorkYellowGroupNoValidatorConnection()
    33  		})
    34  		By("Can recover after all nodes lost connection to validator", func() {
    35  			state.CanRecoverAllNodesValidatorConnectionLoss()
    36  		})
    37  		By("Can work after all nodes restarted", func() {
    38  			state.CanWorkAfterAllOraclesIPChange()
    39  		})
    40  		By("Can work when bootstrap migrated", func() {
    41  			state.CanMigrateBootstrap()
    42  		})
    43  	})
    44  	AfterEach(func() {
    45  		By("Tearing down the environment", func() {
    46  			err := actions.TeardownSuite(state.Env, nil, "logs", nil)
    47  			Expect(err).ShouldNot(HaveOccurred())
    48  		})
    49  	})
    50  })