Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 156 for withCancel (0.2 sec)

  1. 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)
  2. 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)
  3. 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)
  4. cni/pkg/nodeagent/informers_test.go

    	"istio.io/istio/pkg/monitoring/monitortest"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestExistingPodAddedWhenNsLabeled(t *testing.T) {
    	setupLogging()
    	NodeName = "testnode"
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "test",
    			Namespace: "test",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 05:10:23 UTC 2024
    - 22.2K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. src/cmd/vendor/golang.org/x/sync/errgroup/pre_go120.go

    // license that can be found in the LICENSE file.
    
    //go:build !go1.20
    
    package errgroup
    
    import "context"
    
    func withCancelCause(parent context.Context) (context.Context, func(error)) {
    	ctx, cancel := context.WithCancel(parent)
    	return ctx, func(error) { cancel() }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:57:25 UTC 2024
    - 377 bytes
    - Viewed (0)
  8. src/context/context.go

    // calls between them must propagate the Context, optionally replacing
    // it with a derived Context created using [WithCancel], [WithDeadline],
    // [WithTimeout], or [WithValue]. When a Context is canceled, all
    // Contexts derived from it are also canceled.
    //
    // The [WithCancel], [WithDeadline], and [WithTimeout] functions take a
    // Context (the parent) and return a derived Context (the child) and a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 23.7K bytes
    - Viewed (0)
  9. cmd/erasure-object_test.go

    	"runtime"
    	"strconv"
    	"testing"
    
    	"github.com/dustin/go-humanize"
    	"github.com/minio/minio/internal/config/storageclass"
    )
    
    func TestRepeatPutObjectPart(t *testing.T) {
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	var objLayer ObjectLayer
    	var disks []string
    	var err error
    	var opts ObjectOptions
    
    	objLayer, disks, err = prepareErasure16(ctx)
    	if err != nil {
    		t.Fatal(err)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jan 30 20:43:25 UTC 2024
    - 36.8K bytes
    - Viewed (0)
  10. internal/cachevalue/cache_test.go

    			return time.Now(), slowCaller(ctx)
    		},
    	)
    
    	ctx, cancel := context.WithCancel(context.Background())
    	cancel() // cancel context to test.
    
    	_, err := cache.GetWithCtx(ctx)
    	if !errors.Is(err, context.Canceled) {
    		t.Fatalf("expected context.Canceled err, got %v", err)
    	}
    
    	ctx, cancel = context.WithCancel(context.Background())
    	defer cancel()
    
    	t1, err := cache.GetWithCtx(ctx)
    	if err != nil {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 09 00:51:34 UTC 2024
    - 2.7K bytes
    - Viewed (0)
Back to top