@@ -53,22 +53,39 @@ func TestMain(m *testing.M) {
53
53
func TestRobustnessExploratory (t * testing.T ) {
54
54
testRunner .BeforeTest (t )
55
55
for _ , s := range scenarios .Exploratory (t ) {
56
- t .Run (s .Name , func (t * testing.T ) {
56
+ ctx := context .Background ()
57
+ s .Failpoint = randomFailpointForConfig (ctx , t , s .Profile , s .Cluster )
58
+ t .Run (s .Name + "/" + s .Failpoint .Name (), func (t * testing.T ) {
57
59
lg := zaptest .NewLogger (t )
58
60
s .Cluster .Logger = lg
59
- ctx := context .Background ()
60
61
c , err := e2e .NewEtcdProcessCluster (ctx , t , e2e .WithConfig (& s .Cluster ))
61
- require .NoError (t , err )
62
+ if err != nil {
63
+ t .Fatal (err )
64
+ }
62
65
defer forcestopCluster (c )
63
- s .Failpoint , err = failpoint .PickRandom (c , s .Profile )
64
- require .NoError (t , err )
65
- t .Run (s .Failpoint .Name (), func (t * testing.T ) {
66
- testRobustness (ctx , t , lg , s , c )
67
- })
66
+ testRobustness (ctx , t , lg , s , c )
68
67
})
69
68
}
70
69
}
71
70
71
+ // TODO: Implement lightweight a way to generate list of failpoints without needing to start a cluster
72
+ func randomFailpointForConfig (ctx context.Context , t * testing.T , profile traffic.Profile , config e2e.EtcdProcessClusterConfig ) failpoint.Failpoint {
73
+ config .Logger = zap .NewNop ()
74
+ c , err := e2e .NewEtcdProcessCluster (ctx , t , e2e .WithConfig (& config ))
75
+ if err != nil {
76
+ t .Fatal (err )
77
+ }
78
+ f , err := failpoint .PickRandom (c , profile )
79
+ if err != nil {
80
+ t .Fatal (err )
81
+ }
82
+ err = forcestopCluster (c )
83
+ if err != nil {
84
+ t .Fatal (err )
85
+ }
86
+ return f
87
+ }
88
+
72
89
func TestRobustnessRegression (t * testing.T ) {
73
90
testRunner .BeforeTest (t )
74
91
for _ , s := range scenarios .Regression (t ) {
0 commit comments