mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
chore: use WaitForCacheSync method after sharedInformerFactory Start
This commit is contained in:
parent
14b34fc255
commit
a6ee8599f1
@ -82,6 +82,7 @@ func TestMigrateServiceCIDR(t *testing.T) {
|
|||||||
client1,
|
client1,
|
||||||
).Run(tCtx, 5)
|
).Run(tCtx, 5)
|
||||||
informers1.Start(tCtx.Done())
|
informers1.Start(tCtx.Done())
|
||||||
|
informers1.WaitForCacheSync(tCtx.Done())
|
||||||
|
|
||||||
// the default serviceCIDR should have a finalizer and ready condition set to true
|
// the default serviceCIDR should have a finalizer and ready condition set to true
|
||||||
if err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, time.Minute, false, func(ctx context.Context) (bool, error) {
|
if err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, time.Minute, false, func(ctx context.Context) (bool, error) {
|
||||||
@ -220,6 +221,7 @@ func TestMigrateServiceCIDR(t *testing.T) {
|
|||||||
client2,
|
client2,
|
||||||
).Run(tCtx2, 5)
|
).Run(tCtx2, 5)
|
||||||
informers2.Start(tCtx2.Done())
|
informers2.Start(tCtx2.Done())
|
||||||
|
informers2.WaitForCacheSync(tCtx.Done())
|
||||||
|
|
||||||
// delete the kubernetes.default service so the old DefaultServiceCIDR can be deleted
|
// delete the kubernetes.default service so the old DefaultServiceCIDR can be deleted
|
||||||
// and the new apiserver can take over
|
// and the new apiserver can take over
|
||||||
|
@ -68,6 +68,7 @@ func TestServiceAllocNewServiceCIDR(t *testing.T) {
|
|||||||
client,
|
client,
|
||||||
).Run(ctx, 5)
|
).Run(ctx, 5)
|
||||||
informerFactory.Start(ctx.Done())
|
informerFactory.Start(ctx.Done())
|
||||||
|
informerFactory.WaitForCacheSync(ctx.Done())
|
||||||
|
|
||||||
// /29 = 6 services, kubernetes.default takes the first address
|
// /29 = 6 services, kubernetes.default takes the first address
|
||||||
// make 5 more services to take up all IPs
|
// make 5 more services to take up all IPs
|
||||||
@ -169,6 +170,7 @@ func TestServiceCIDRDeletion(t *testing.T) {
|
|||||||
client,
|
client,
|
||||||
).Run(ctx, 5)
|
).Run(ctx, 5)
|
||||||
informerFactory.Start(ctx.Done())
|
informerFactory.Start(ctx.Done())
|
||||||
|
informerFactory.WaitForCacheSync(ctx.Done())
|
||||||
|
|
||||||
// /29 = 6 services, kubernetes.default takes the first address
|
// /29 = 6 services, kubernetes.default takes the first address
|
||||||
// make 5 more services to take up all IPs
|
// make 5 more services to take up all IPs
|
||||||
|
Loading…
Reference in New Issue
Block a user