Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 75 for withCancel (0.35 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. cmd/server-startup-msg_test.go

    		t.Fatalf("Expected %#v, got %#v", apiEndpoints, newAPIEndpoints)
    	}
    }
    
    // Test printing server common message.
    func TestPrintServerCommonMessage(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: Tue Jun 20 00:53:08 UTC 2023
    - 4K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go

    			return true
    		}
    		stack = append(stack, n) // push
    
    		// Look for [{AssignStmt,ValueSpec} CallExpr SelectorExpr]:
    		//
    		//   ctx, cancel    := context.WithCancel(...)
    		//   ctx, cancel     = context.WithCancel(...)
    		//   var ctx, cancel = context.WithCancel(...)
    		//
    		if !isContextWithCancel(pass.TypesInfo, n) || !isCall(stack[len(stack)-2]) {
    			return true
    		}
    		var id *ast.Ident // id of cancel var
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 9K bytes
    - Viewed (0)
Back to top