Skip to content

Commit

Permalink
increase pv controller resync period to try to deflake api update con…
Browse files Browse the repository at this point in the history
…flicts
  • Loading branch information
msau42 committed Nov 26, 2019
1 parent 384e45f commit 5b1fb22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/integration/volumescheduling/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ go_test(
tags = ["integration"],
deps = [
"//pkg/controller/volume/persistentvolume:go_default_library",
"//pkg/controller/volume/persistentvolume/options:go_default_library",
"//pkg/scheduler/algorithm/predicates:go_default_library",
"//pkg/volume:go_default_library",
"//pkg/volume/testing:go_default_library",
Expand Down
10 changes: 5 additions & 5 deletions test/integration/volumescheduling/volume_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/util/workqueue"
"k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
persistentvolumeoptions "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/options"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
Expand Down Expand Up @@ -926,7 +925,7 @@ func setupCluster(t *testing.T, nsName string, numberOfNodes int, resyncPeriod t

func initPVController(context *testContext, provisionDelaySeconds int) (*persistentvolume.PersistentVolumeController, informers.SharedInformerFactory, error) {
clientset := context.clientSet
// Informers factory for controllers, we disable resync period for testing.
// Informers factory for controllers
informerFactory := informers.NewSharedInformerFactory(clientset, 0)

// Start PV controller for volume binding.
Expand All @@ -946,10 +945,11 @@ func initPVController(context *testContext, provisionDelaySeconds int) (*persist
}
plugins := []volume.VolumePlugin{plugin}

controllerOptions := persistentvolumeoptions.NewPersistentVolumeControllerOptions()
params := persistentvolume.ControllerParameters{
KubeClient: clientset,
SyncPeriod: controllerOptions.PVClaimBinderSyncPeriod,
KubeClient: clientset,
// Use a frequent resync period to retry API update conflicts due to
// https://github.com/kubernetes/kubernetes/issues/85320
SyncPeriod: 5 * time.Second,
VolumePlugins: plugins,
Cloud: nil,
ClusterName: "volume-test-cluster",
Expand Down

0 comments on commit 5b1fb22

Please sign in to comment.