Skip to content

Commit

Permalink
Fix crash in e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-prodan committed Sep 30, 2018
1 parent ed70edb commit 6f8561c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/e2e/fleetautoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ func TestAutoScalerStressCreate(t *testing.T) {
for i := 0; i < 30; i++ {
fas := defaultFleetAutoScaler(flt)
bufferSize := r.Int31n(10)
minReplicas := r.Int31n(10)
maxReplicas := r.Int31n(10)
fas.Spec.Policy.Buffer.BufferSize = intstr.FromInt(int(bufferSize))
fas.Spec.Policy.Buffer.MinReplicas = r.Int31n(10)
fas.Spec.Policy.Buffer.MaxReplicas = r.Int31n(10)
fas.Spec.Policy.Buffer.MinReplicas = minReplicas
fas.Spec.Policy.Buffer.MaxReplicas = maxReplicas

valid := bufferSize > 0 &&
fas.Spec.Policy.Buffer.MaxReplicas > 0 &&
Expand Down Expand Up @@ -150,8 +152,8 @@ func TestAutoScalerStressCreate(t *testing.T) {
assert.False(t, valid,
fmt.Sprintf("FleetAutoscaler NOT created even if the parameters are valid: %d %d %d",
bufferSize,
fas.Spec.Policy.Buffer.MinReplicas,
fas.Spec.Policy.Buffer.MaxReplicas))
minReplicas,
maxReplicas))
}
}
}
Expand Down

0 comments on commit 6f8561c

Please sign in to comment.