- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 237 for withCancel (0.22 sec)
-
cmd/shared-lock.go
case ld.lockContext <- lkctx: // Send the lock context to anyone asking for it } } } } func mergeContext(ctx1, ctx2 context.Context) (context.Context, context.CancelFunc) { ctx, cancel := context.WithCancel(context.Background()) go func() { select { case <-ctx1.Done(): case <-ctx2.Done(): // The lock acquirer decides to cancel, exit this goroutine case <-ctx.Done(): } cancel() }()
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Feb 13 09:26:38 UTC 2023 - 2.3K bytes - Viewed (0) -
pkg/controller/volume/attachdetach/reconciler/reconciler_test.go
reconcilerLoopPeriod, maxWaitForUnmountDuration, syncLoopPeriod, false, false, dsw, asw, ad, nsu, nodeLister, fakeRecorder) // Act _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancel(ctx) defer cancel() go reconciler.Run(ctx) // Assert waitForNewAttacherCallCount(t, 0 /* expectedCallCount */, fakePlugin) verifyNewAttacherCallCount(t, true /* expectZeroNewAttacherCallCount */, fakePlugin)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Apr 18 07:00:14 UTC 2024 - 72.8K bytes - Viewed (0) -
pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go
}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancel(ctx) defer cancel() state := framework.NewCycleState() node := &framework.NodeInfo{} node.SetNode(test.Node) p := &VolumeZone{ pvLister, pvcLister, nil, }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Dec 14 05:17:04 UTC 2023 - 20K bytes - Viewed (0) -
src/os/signal/signal.go
var buf []byte // We know that the type of c.Context is context.cancelCtx, and we know that the // String method of cancelCtx returns a string that ends with ".WithCancel". name := c.Context.(stringer).String() name = name[:len(name)-len(".WithCancel")] buf = append(buf, "signal.NotifyContext("+name...) if len(c.signals) != 0 { buf = append(buf, ", ["...) for i, s := range c.signals {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:33:12 UTC 2024 - 8.3K bytes - Viewed (0) -
src/os/signal/signal_test.go
} parent, cancelParent := context.WithCancel(context.Background()) defer cancelParent() c, stop := NotifyContext(parent, syscall.SIGHUP) defer stop() // If we're being notified, then the signal should not be ignored. if Ignored(syscall.SIGHUP) { t.Errorf("expected SIGHUP to not be ignored.") } if want, got := "signal.NotifyContext(context.Background.WithCancel, [hangup])", fmt.Sprint(c); want != got {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 09 15:34:56 UTC 2023 - 27.2K bytes - Viewed (0) -
src/database/sql/example_cli_test.go
log.Fatal("unable to use data source name", err) } defer pool.Close() pool.SetConnMaxLifetime(0) pool.SetMaxIdleConns(3) pool.SetMaxOpenConns(3) ctx, stop := context.WithCancel(context.Background()) defer stop() appSignal := make(chan os.Signal, 3) signal.Notify(appSignal, os.Interrupt) go func() { <-appSignal stop() }() Ping(ctx) Query(ctx, *id)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun May 08 17:27:54 UTC 2022 - 2K bytes - Viewed (0) -
src/net/tcpsock_unix_test.go
defer dnsWaitGroup.Wait() t.Parallel() const tries = 10000 var wg sync.WaitGroup wg.Add(tries * 2) sem := make(chan bool, 5) for i := 0; i < tries; i++ { sem <- true ctx, cancel := context.WithCancel(context.Background()) go func() { defer wg.Done() time.Sleep(time.Duration(rand.Int63n(int64(5 * time.Millisecond)))) cancel() }() go func(i int) { defer wg.Done() var dialer Dialer
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 17:20:52 UTC 2023 - 2.3K bytes - Viewed (0) -
pkg/scheduler/framework/plugins/defaultbinder/default_binder_test.go
name: "binding error", injectErr: errors.New("binding error"), }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancel(ctx) defer cancel() var gotBinding *v1.Binding client := fake.NewSimpleClientset(testPod) client.PrependReactor("create", "pods", func(action clienttesting.Action) (bool, runtime.Object, error) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue May 23 02:17:34 UTC 2023 - 2.6K bytes - Viewed (0) -
cmd/lock-rest-client_test.go
} endpointLocal, err := NewEndpoint("http://localhost:9012") if err != nil { t.Fatalf("unexpected error %v", err) } endpointLocal.IsLocal = true ctx, cancel := context.WithCancel(context.Background()) defer cancel() err = initGlobalGrid(ctx, []PoolEndpoints{{Endpoints: Endpoints{endpoint, endpointLocal}}}) if err != nil { t.Fatal(err) } lkClient := newlockRESTClient(endpoint)
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Tue Nov 21 01:09:35 UTC 2023 - 2K bytes - Viewed (0) -
cmd/erasure-healing_test.go
t.Errorf("Expected dangling %t, got %t", testCase.expectedDangling, dangling) } }) } } // Tests both object and bucket healing. func TestHealing(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() obj, fsDirs, err := prepareErasure16(ctx) if err != nil { t.Fatal(err) } defer obj.Shutdown(context.Background())
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Jun 10 15:51:27 UTC 2024 - 49K bytes - Viewed (0)