@@ -81,8 +81,6 @@ var _ = BeforeSuite(func() {
81
81
defer close (hdtcc )
82
82
83
83
zones := strings .Split (* zones , "," )
84
- // Create 2 instances for each zone as we need 2 instances each zone for certain test cases
85
-
86
84
rand .Seed (time .Now ().UnixNano ())
87
85
88
86
computeService , err = remote .GetComputeClient ()
@@ -109,27 +107,31 @@ var _ = BeforeSuite(func() {
109
107
110
108
numberOfInstancesPerZone := 2
111
109
112
- setupContext := func (zones []string , randInt int ) {
113
- for _ , zone := range zones {
114
- go func (curZone string ) {
110
+ setupContext := func (zone string ) {
111
+ // Create 2 instances for each zone as we need 2 instances each zone for certain test cases
112
+ for j := 0 ; j < numberOfInstancesPerZone ; j ++ {
113
+ go func (curZone string , randInt int ) {
115
114
defer GinkgoRecover ()
116
115
tcc <- NewDefaultTestContext (curZone , strconv .Itoa (randInt ))
117
- }(zone )
118
- go func (curZone string ) {
119
- defer GinkgoRecover ()
120
- hdtcc <- NewTestContext (curZone , * hdMinCpuPlatform , * hdMachineType , strconv .Itoa (randInt ))
121
- }(zone )
116
+ }(zone , j )
122
117
}
118
+ go func (curZone string ) {
119
+ defer GinkgoRecover ()
120
+ hdtcc <- NewTestContext (curZone , * hdMinCpuPlatform , * hdMachineType , "0" )
121
+ }(zone )
123
122
}
124
- for j := 0 ; j < numberOfInstancesPerZone ; j ++ {
125
- setupContext (zones , j )
123
+
124
+ for _ , zone := range zones {
125
+ setupContext (zone )
126
126
}
127
127
128
128
for i := 0 ; i < len (zones )* numberOfInstancesPerZone ; i ++ {
129
129
tc := <- tcc
130
130
testContexts = append (testContexts , tc )
131
131
klog .Infof ("Added TestContext for node %s" , tc .Instance .GetName ())
132
- tc = <- hdtcc
132
+ }
133
+ for i := 0 ; i < len (zones ); i ++ {
134
+ tc := <- hdtcc
133
135
hyperdiskTestContexts = append (hyperdiskTestContexts , tc )
134
136
klog .Infof ("Added TestContext for node %s" , tc .Instance .GetName ())
135
137
}
@@ -178,6 +180,11 @@ func NewTestContext(zone, minCpuPlatform, machineType string, instanceNumber str
178
180
ComputeService : computeService ,
179
181
LocalSSDCount : localSSDCount ,
180
182
}
183
+
184
+ if machineType == * hdMachineType {
185
+ // Machine type is defaulted to c3-standard-2 which doesn't support LSSD and we don't need LSSD for HdHA test context
186
+ instanceConfig .LocalSSDCount = 0
187
+ }
181
188
i , err := remote .SetupInstance (instanceConfig )
182
189
if err != nil {
183
190
klog .Fatalf ("Failed to setup instance %v: %v" , nodeID , err )
0 commit comments