77 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
88 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
99 ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
10- "github.com/smartcontractkit/chainlink-testing-framework/wasp"
1110 "github.com/stretchr/testify/require"
12- "os"
1311 "testing"
1412 "time"
1513)
@@ -31,37 +29,44 @@ func TestLoad(t *testing.T) {
3129 out , err := ns .NewSharedDBNodeSet (in .NodeSet , bc , dp .BaseURLDocker )
3230 require .NoError (t , err )
3331
34- var lokiCfg * wasp.LokiConfig
35- // temp fix, we can't reach shared Loki instance in CI
36- if os .Getenv ("CI" ) != "true" {
37- lokiCfg = wasp .NewEnvLokiConfig ()
38- }
32+ // var lokiCfg *wasp.LokiConfig
33+ //// temp fix, we can't reach shared Loki instance in CI
34+ // if os.Getenv("CI") != "true" {
35+ // lokiCfg = wasp.NewEnvLokiConfig()
36+ // }
3937
40- c , err : = clclient .NewCLDefaultClients (out .CLNodes , framework .L )
38+ _ , err = clclient .NewCLDefaultClients (out .CLNodes , framework .L )
4139 require .NoError (t , err )
4240
4341 t .Run ("run the cluster and simulate slow network" , func (t * testing.T ) {
44- p , err := wasp .NewProfile ().
45- Add (wasp .NewGenerator (& wasp.Config {
46- T : t ,
47- LoadType : wasp .RPS ,
48- Schedule : wasp .Combine (
49- wasp .Steps (1 , 1 , 9 , 30 * time .Second ),
50- wasp .Plain (10 , 30 * time .Second ),
51- wasp .Steps (10 , - 1 , 10 , 30 * time .Second ),
52- ),
53- Gun : NewCLNodeGun (c [0 ], "bridges" ),
54- Labels : map [string ]string {
55- "gen_name" : "cl_node_api_call" ,
56- "branch" : "example" ,
57- "commit" : "example" ,
58- },
59- LokiConfig : lokiCfg ,
60- })).
61- Run (false )
42+ //p, err := wasp.NewProfile().
43+ // Add(wasp.NewGenerator(&wasp.Config{
44+ // T: t,
45+ // LoadType: wasp.RPS,
46+ // Schedule: wasp.Combine(
47+ // wasp.Steps(1, 1, 9, 30*time.Second),
48+ // wasp.Plain(10, 30*time.Second),
49+ // wasp.Steps(10, -1, 10, 30*time.Second),
50+ // ),
51+ // Gun: NewCLNodeGun(c[0], "bridges"),
52+ // Labels: map[string]string{
53+ // "gen_name": "cl_node_api_call",
54+ // "branch": "example",
55+ // "commit": "example",
56+ // },
57+ // LokiConfig: lokiCfg,
58+ // })).
59+ // Run(false)
60+ //require.NoError(t, err)
61+ // example commands for Pumba:
62+ // stop --duration=1s --restart re2:node0 # stop one container for 1s and restart
63+ // "netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.* # slow network
64+ _ , err = chaos .ExecPumba ("stop --duration=1s --restart re2:node0" )
6265 require .NoError (t , err )
63- _ , err = chaos .ExecPumba ("netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.*" )
66+ time .Sleep (5 * time .Second )
67+ _ , err = clclient .NewCLDefaultClients (out .CLNodes , framework .L )
6468 require .NoError (t , err )
65- p .Wait ()
69+
70+ //p.Wait()
6671 })
6772}
0 commit comments