- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 237 for withCancel (0.2 sec)
-
src/context/context_test.go
t.Errorf("%s: context has %d children, want %d", when, got, want) } } ctx, _ := WithCancel(Background()) checkChildren("after creation", ctx, 0) _, cancel := WithCancel(ctx) checkChildren("with WithCancel child ", ctx, 1) cancel() checkChildren("after canceling WithCancel child", ctx, 0) ctx, _ = WithCancel(Background()) checkChildren("after creation", ctx, 0) _, cancel = WithTimeout(ctx, 60*time.Minute)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 19 19:13:01 UTC 2023 - 7.7K bytes - Viewed (0) -
src/context/afterfunc_test.go
ctx0 := &afterFuncContext{} _, cancel1 := context.WithCancel(ctx0) _, cancel2 := context.WithCancel(ctx0) if got, want := len(ctx0.afterFuncs), 2; got != want { t.Errorf("after WithCancel(ctx0): ctx0 has %v afterFuncs, want %v", got, want) } cancel1() cancel2() if got, want := len(ctx0.afterFuncs), 0; got != want { t.Errorf("after canceling WithCancel(ctx0): ctx0 has %v afterFuncs, want %v", got, want) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 16:58:52 UTC 2023 - 3.4K bytes - Viewed (0) -
src/net/cgo_unix_test.go
_, err := cgoLookupIP(ctx, "ip", "localhost") if err != nil { t.Error(err) } } func TestCgoLookupIPWithCancel(t *testing.T) { defer dnsWaitGroup.Wait() ctx, cancel := context.WithCancel(context.Background()) defer cancel() _, err := cgoLookupIP(ctx, "ip", "localhost") if err != nil { t.Error(err) } } func TestCgoLookupPort(t *testing.T) { defer dnsWaitGroup.Wait()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 04 16:28:59 UTC 2023 - 1.4K bytes - Viewed (0) -
src/context/benchmark_test.go
"time" ) func BenchmarkCommonParentCancel(b *testing.B) { root := WithValue(Background(), "key", "value") shared, sharedcancel := WithCancel(root) defer sharedcancel() b.ResetTimer() b.RunParallel(func(pb *testing.PB) { x := 0 for pb.Next() { ctx, cancel := WithCancel(shared) if ctx.Value("key").(string) != "value" { b.Fatal("should not be reached") } for i := 0; i < 100; i++ { x /= x + 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Oct 02 00:44:24 UTC 2021 - 3.8K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/doc.go
// call a context cancellation function. // // # Analyzer lostcancel // // lostcancel: check cancel func returned by context.WithCancel is called // // The cancellation function returned by context.WithCancel, WithTimeout, // and WithDeadline must be called or the new context will remain live // until its parent context is cancelled. // (The background context is never cancelled.)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 09 01:28:01 UTC 2023 - 632 bytes - Viewed (0) -
pilot/cmd/pilot-agent/status/ready/probe_test.go
noServerStats = "" ) func TestEnvoyStatsCompleteAndSuccessful(t *testing.T) { g := NewWithT(t) server := testserver.CreateAndStartServer(liveServerStats) defer server.Close() ctx, cancel := context.WithCancel(context.Background()) defer cancel() probe := Probe{AdminPort: uint16(server.Listener.Addr().(*net.TCPAddr).Port)} probe.Context = ctx err := probe.Check() g.Expect(err).NotTo(HaveOccurred()) }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Oct 31 14:48:28 UTC 2023 - 5.9K bytes - Viewed (0) -
pkg/kubelet/config/mux_test.go
limitations under the License. */ package config import ( "context" "reflect" "testing" ) func TestConfigurationChannels(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() mux := newMux(nil) channelOne := mux.ChannelWithContext(ctx, "one") if channelOne != mux.ChannelWithContext(ctx, "one") {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jan 30 20:02:23 UTC 2024 - 2.5K bytes - Viewed (0) -
cmd/jwt_test.go
token := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, claims) return token.SignedString([]byte(secretKey)) } // Tests web request authenticator. func TestWebRequestAuthenticate(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() obj, fsDir, err := prepareFS(ctx) if err != nil { t.Fatal(err) } defer os.RemoveAll(fsDir) if err = newTestConfig(globalMinioDefaultRegion, obj); err != nil {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri Apr 19 16:45:14 UTC 2024 - 4.5K bytes - Viewed (0) -
src/context/x_test.go
t.Errorf("TODO().String() = %q want %q", got, want) } } func TestWithCancel(t *testing.T) { c1, cancel := WithCancel(Background()) if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want { t.Errorf("c1.String() = %q want %q", got, want) } o := otherContext{c1} c2, _ := WithCancel(o) contexts := []Context{c1, o, c2} for i, c := range contexts { if d := c.Done(); d == nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 26.3K bytes - Viewed (0) -
cni/pkg/nodeagent/net_test.go
UID: "123", }, Spec: corev1.PodSpec{ Containers: containers, }, Status: podStatus, } } func TestServerAddPod(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() setupLogging() fixture := getTestFixure(ctx) netServer := fixture.netServer ztunnelServer := fixture.ztunnelServer podMeta := metav1.ObjectMeta{ Name: "foo",
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Jun 06 05:10:23 UTC 2024 - 17.8K bytes - Viewed (0)