test: disable the namespace cache unconditionally for context created by V23Init
This allows us to remove a bunch of explicit calls to disabling the cache (most
of which were already unnecessary).
Change-Id: I420e4811788d71ced4561554719e68562e8f6d8c
diff --git a/runtime/factories/fake/naming.go b/runtime/factories/fake/naming.go
index 289ce46..b4a14ed 100644
--- a/runtime/factories/fake/naming.go
+++ b/runtime/factories/fake/naming.go
@@ -20,6 +20,6 @@
panic("unimplemented")
}
func (r *Runtime) GetNamespace(ctx *context.T) namespace.T {
- defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
- panic("unimplemented")
+ // nologcall
+ return r.ns
}
diff --git a/runtime/factories/fake/rpc.go b/runtime/factories/fake/rpc.go
index 1d8ccdf..c38271c 100644
--- a/runtime/factories/fake/rpc.go
+++ b/runtime/factories/fake/rpc.go
@@ -39,6 +39,6 @@
}
func (r *Runtime) WithListenSpec(ctx *context.T, ls rpc.ListenSpec) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
return ctx
}
diff --git a/runtime/factories/fake/runtime.go b/runtime/factories/fake/runtime.go
index 16ee8a4..2282a47 100644
--- a/runtime/factories/fake/runtime.go
+++ b/runtime/factories/fake/runtime.go
@@ -7,10 +7,12 @@
import (
"v.io/v23"
"v.io/v23/context"
+ "v.io/v23/namespace"
"v.io/v23/rpc"
"v.io/v23/security"
-
+ "v.io/x/ref/lib/apilog"
vsecurity "v.io/x/ref/lib/security"
+ tnaming "v.io/x/ref/runtime/internal/testing/mocks/naming"
)
type contextKey int
@@ -22,7 +24,9 @@
backgroundKey
)
-type Runtime struct{}
+type Runtime struct {
+ ns namespace.T
+}
func new(ctx *context.T) (*Runtime, *context.T, v23.Shutdown, error) {
p, err := vsecurity.NewPrincipal()
@@ -30,16 +34,16 @@
return nil, nil, func() {}, err
}
ctx = context.WithValue(ctx, principalKey, p)
- return &Runtime{}, ctx, func() {}, nil
+ return &Runtime{ns: tnaming.NewSimpleNamespace()}, ctx, func() {}, nil
}
func (r *Runtime) Init(ctx *context.T) error {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
return nil
}
func (r *Runtime) WithPrincipal(ctx *context.T, principal security.Principal) (*context.T, error) {
- // nologcall
+ defer apilog.LogCallf(ctx, "principal=%v", principal)(ctx, "") // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
return context.WithValue(ctx, principalKey, principal), nil
}
@@ -55,7 +59,7 @@
}
func (r *Runtime) WithBackgroundContext(ctx *context.T) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
// Note we add an extra context with a nil value here.
// This prevents users from travelling back through the
// chain of background contexts.
@@ -77,7 +81,7 @@
}
func (*Runtime) WithReservedNameDispatcher(ctx *context.T, d rpc.Dispatcher) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
panic("unimplemented")
}
diff --git a/runtime/internal/rpc/test/client_test.go b/runtime/internal/rpc/test/client_test.go
index c886455..7ea8425 100644
--- a/runtime/internal/rpc/test/client_test.go
+++ b/runtime/internal/rpc/test/client_test.go
@@ -129,12 +129,6 @@
return nil
}, "echoClient")
-func newCtx() (*context.T, v23.Shutdown) {
- ctx, shutdown := test.V23Init()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
- return ctx, shutdown
-}
-
func runMountTable(t *testing.T, ctx *context.T, args ...string) (*modules.Shell, func()) {
sh, err := modules.NewShell(ctx, nil, testing.Verbose(), t)
if err != nil {
@@ -185,7 +179,7 @@
// TODO(cnicolaou): figure out how to test and see what the internals
// of tryCall are doing - e.g. using stats counters.
func TestMultipleEndpoints(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
sh, fn := runMountTable(t, ctx)
@@ -237,7 +231,7 @@
}
func TestTimeout(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
client := v23.GetClient(ctx)
ctx, _ = context.WithTimeout(ctx, 100*time.Millisecond)
@@ -264,12 +258,11 @@
}
func TestStartCallErrors(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
client := v23.GetClient(ctx)
ns := v23.GetNamespace(ctx)
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
logErr := func(msg string, err error) {
logErrors(t, msg, true, false, false, err)
@@ -405,12 +398,11 @@
}
func TestStartCallBadProtocol(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
client := v23.GetClient(ctx)
ns := v23.GetNamespace(ctx)
- ns.CacheCtl(naming.DisableCache(true))
logErr := func(msg string, err error) {
logErrors(t, msg, true, false, false, err)
@@ -470,7 +462,7 @@
}
func TestStartCallSecurity(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
client := v23.GetClient(ctx)
@@ -500,7 +492,6 @@
var childPing = modules.Register(func(env *modules.Env, args ...string) error {
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
name := args[0]
got := ""
@@ -521,7 +512,7 @@
}
func TestTimeoutResponse(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -534,7 +525,7 @@
}
func TestArgsAndResponses(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -584,7 +575,7 @@
}
func TestCanceledBeforeFinish(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -603,7 +594,7 @@
}
func TestCanceledDuringFinish(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -625,7 +616,7 @@
}
func TestRendezvous(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
sh, fn := runMountTable(t, ctx)
defer fn()
@@ -661,7 +652,7 @@
}
func TestCallback(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
sh, fn := runMountTable(t, ctx)
defer fn()
@@ -680,7 +671,7 @@
}
func TestStreamTimeout(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -718,7 +709,7 @@
}
func TestStreamAbort(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -751,7 +742,7 @@
}
func TestNoServersAvailable(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
_, fn := runMountTable(t, ctx)
defer fn()
@@ -771,7 +762,7 @@
}
func TestNoMountTable(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
v23.GetNamespace(ctx).SetRoots()
name := "a_mount_table_entry"
@@ -847,7 +838,7 @@
}
func TestMethodErrors(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
clt := v23.GetClient(ctx)
@@ -938,7 +929,7 @@
}
func TestReservedMethodErrors(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
clt := v23.GetClient(ctx)
diff --git a/runtime/internal/rpc/test/simple_test.go b/runtime/internal/rpc/test/simple_test.go
index 1ce55f8..4167007 100644
--- a/runtime/internal/rpc/test/simple_test.go
+++ b/runtime/internal/rpc/test/simple_test.go
@@ -12,6 +12,7 @@
"v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
+ "v.io/x/ref/test"
)
type simple struct {
@@ -75,7 +76,7 @@
}
func TestSimpleRPC(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
@@ -95,7 +96,7 @@
}
func TestSimpleStreaming(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
name, fn := initServer(t, ctx)
defer fn()
diff --git a/runtime/internal/rt/runtime.go b/runtime/internal/rt/runtime.go
index 5f62d86..e3d8a1b 100644
--- a/runtime/internal/rt/runtime.go
+++ b/runtime/internal/rt/runtime.go
@@ -334,7 +334,7 @@
}
func (r *Runtime) WithPrincipal(ctx *context.T, principal security.Principal) (*context.T, error) {
- defer apilog.LogCallf(ctx, "principal=")(ctx, "") // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
+ defer apilog.LogCallf(ctx, "principal=%v", principal)(ctx, "") // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
var err error
newctx := ctx
@@ -449,12 +449,12 @@
}
func (*Runtime) WithListenSpec(ctx *context.T, ls rpc.ListenSpec) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
return context.WithValue(ctx, listenKey, ls.Copy())
}
func (*Runtime) WithBackgroundContext(ctx *context.T) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
// Note we add an extra context with a nil value here.
// This prevents users from travelling back through the
// chain of background contexts.
@@ -476,7 +476,7 @@
}
func (*Runtime) WithReservedNameDispatcher(ctx *context.T, d rpc.Dispatcher) *context.T {
- // nologcall
+ defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
return context.WithValue(ctx, reservedNameKey, d)
}
diff --git a/runtime/internal/rt/runtime_test.go b/runtime/internal/rt/runtime_test.go
index cfae57f..342da80 100644
--- a/runtime/internal/rt/runtime_test.go
+++ b/runtime/internal/rt/runtime_test.go
@@ -17,8 +17,8 @@
"v.io/x/ref/test/testutil"
)
-// InitForTest creates a context for use in a test.
-func InitForTest(t *testing.T) (*rt.Runtime, *context.T, v23.Shutdown) {
+// initForTest creates a context for use in a test.
+func initForTest(t *testing.T) (*rt.Runtime, *context.T, v23.Shutdown) {
ctx, cancel := context.RootContext()
r, ctx, shutdown, err := rt.Init(ctx, nil, nil, nil, nil, "", flags.RuntimeFlags{}, nil)
if err != nil {
@@ -34,7 +34,7 @@
}
func TestNewServer(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
if s, err := r.NewServer(ctx); err != nil || s == nil {
@@ -43,7 +43,7 @@
}
func TestPrincipal(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
p2 := testutil.NewPrincipal()
@@ -60,7 +60,7 @@
}
func TestClient(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
orig := r.GetClient(ctx)
@@ -81,7 +81,7 @@
}
func TestNamespace(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
orig := r.GetNamespace(ctx)
@@ -117,7 +117,7 @@
}
func TestBackgroundContext(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
bgctx := r.GetBackgroundContext(ctx)
@@ -133,7 +133,7 @@
}
func TestReservedNameDispatcher(t *testing.T) {
- r, ctx, shutdown := InitForTest(t)
+ r, ctx, shutdown := initForTest(t)
defer shutdown()
oldDebugDisp := r.GetReservedNameDispatcher(ctx)
diff --git a/runtime/internal/testing/mocks/mocknet/mocknet_test.go b/runtime/internal/testing/mocks/mocknet/mocknet_test.go
index 8e7a73c..e93baf3 100644
--- a/runtime/internal/testing/mocks/mocknet/mocknet_test.go
+++ b/runtime/internal/testing/mocks/mocknet/mocknet_test.go
@@ -325,12 +325,6 @@
}
}
-func newCtx() (*context.T, v23.Shutdown) {
- ctx, shutdown := test.V23Init()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
- return ctx, shutdown
-}
-
type simple struct{}
func (s *simple) Ping(ctx *context.T, call rpc.ServerCall) (string, error) {
@@ -348,7 +342,7 @@
}
func TestV23Control(t *testing.T) {
- ctx, shutdown := newCtx()
+ ctx, shutdown := test.V23Init()
defer shutdown()
matcher := func(_ bool, msg message.T) bool {
diff --git a/services/application/applicationd/perms_test.go b/services/application/applicationd/perms_test.go
index 207c0a2..f934eec 100644
--- a/services/application/applicationd/perms_test.go
+++ b/services/application/applicationd/perms_test.go
@@ -12,7 +12,6 @@
"testing"
"v.io/v23"
- "v.io/v23/naming"
"v.io/v23/security"
"v.io/v23/security/access"
"v.io/v23/services/application"
@@ -208,7 +207,6 @@
func TestPerAppPermissions(t *testing.T) {
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
// By default, all principals in this test will have blessings generated based
// on the username/machine running this process. Give them recognizable names
// ("root/self" etc.), so the Permissions can be set deterministically.
diff --git a/services/device/internal/impl/proxy_invoker_test.go b/services/device/internal/impl/proxy_invoker_test.go
index a3e414d..e6dea74 100644
--- a/services/device/internal/impl/proxy_invoker_test.go
+++ b/services/device/internal/impl/proxy_invoker_test.go
@@ -8,7 +8,6 @@
"reflect"
"testing"
- "v.io/v23"
"v.io/v23/context"
"v.io/v23/naming"
"v.io/v23/rpc"
@@ -27,8 +26,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
// server1 is a normal server
server1, err := xrpc.NewServer(ctx, "", &dummy{}, nil)
if err != nil {
diff --git a/services/device/internal/impl/utiltest/app.go b/services/device/internal/impl/utiltest/app.go
index 093796d..fb92f4c 100644
--- a/services/device/internal/impl/utiltest/app.go
+++ b/services/device/internal/impl/utiltest/app.go
@@ -17,7 +17,6 @@
"v.io/v23"
"v.io/v23/context"
- "v.io/v23/naming"
"v.io/v23/rpc"
"v.io/v23/security"
"v.io/x/lib/vlog"
@@ -129,8 +128,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
if expected, got := 1, len(args); expected != got {
vlog.Fatalf("Unexpected number of arguments: expected %d, got %d", expected, got)
}
diff --git a/services/device/internal/impl/utiltest/helpers.go b/services/device/internal/impl/utiltest/helpers.go
index 11141ad..86cacfe 100644
--- a/services/device/internal/impl/utiltest/helpers.go
+++ b/services/device/internal/impl/utiltest/helpers.go
@@ -561,7 +561,6 @@
// boiler plate across all device manager tests.
func StartupHelper(t *testing.T) (func(), *context.T, *modules.Shell, *application.Envelope, string, string, *testutil.IDProvider) {
ctx, shutdown := test.V23Init()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
// Make a new identity context.
idp := testutil.NewIDProvider("root")
diff --git a/services/device/internal/impl/utiltest/modules.go b/services/device/internal/impl/utiltest/modules.go
index 84f1d00..7a96c96 100644
--- a/services/device/internal/impl/utiltest/modules.go
+++ b/services/device/internal/impl/utiltest/modules.go
@@ -12,7 +12,6 @@
"testing"
"v.io/v23"
- "v.io/v23/naming"
"v.io/v23/rpc"
"v.io/x/lib/vlog"
@@ -68,7 +67,6 @@
defer fmt.Fprintf(env.Stdout, "%v terminated\n", publishName)
defer vlog.VI(1).Infof("%v terminated", publishName)
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
// Satisfy the contract described in doc.go by passing the config state
// through to the device manager dispatcher constructor.
diff --git a/services/internal/binarylib/client_test.go b/services/internal/binarylib/client_test.go
index e06b912..460f44a 100644
--- a/services/internal/binarylib/client_test.go
+++ b/services/internal/binarylib/client_test.go
@@ -77,8 +77,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
von, cleanup := setupRepository(t, ctx)
defer cleanup()
data := testutil.RandomBytes(testutil.RandomIntn(10 << 20))
@@ -131,8 +129,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
von, cleanup := setupRepository(t, ctx)
defer cleanup()
// Create up to 10MB of random bytes.
@@ -188,8 +184,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
von, cleanup := setupRepository(t, ctx)
defer cleanup()
url, _, err := DownloadUrl(ctx, von)
diff --git a/services/internal/binarylib/http_test.go b/services/internal/binarylib/http_test.go
index 5e11215..a01a4f6 100644
--- a/services/internal/binarylib/http_test.go
+++ b/services/internal/binarylib/http_test.go
@@ -12,8 +12,6 @@
"net/http"
"testing"
- "v.io/v23"
- "v.io/v23/naming"
"v.io/v23/services/repository"
"v.io/x/ref/services/internal/binarylib"
@@ -27,8 +25,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
// TODO(caprita): This is based on TestMultiPart (impl_test.go). Share
// the code where possible.
for length := 2; length < 5; length++ {
diff --git a/services/internal/binarylib/impl_test.go b/services/internal/binarylib/impl_test.go
index e46bcbf..054f5ca 100644
--- a/services/internal/binarylib/impl_test.go
+++ b/services/internal/binarylib/impl_test.go
@@ -14,7 +14,6 @@
"reflect"
"testing"
- "v.io/v23"
"v.io/v23/context"
"v.io/v23/naming"
"v.io/v23/services/repository"
@@ -81,8 +80,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
for i := 0; i < md5.Size; i++ {
binary, ep, _, cleanup := startServer(t, ctx, i)
defer cleanup()
@@ -135,8 +132,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
for length := 2; length < 5; length++ {
binary, _, _, cleanup := startServer(t, ctx, 2)
defer cleanup()
@@ -190,8 +185,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
for length := 2; length < 5; length++ {
binary, _, _, cleanup := startServer(t, ctx, 2)
defer cleanup()
@@ -238,8 +231,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
binary, _, _, cleanup := startServer(t, ctx, 2)
defer cleanup()
const length = 2
@@ -305,8 +296,6 @@
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
-
_, ep, _, cleanup := startServer(t, ctx, 2)
defer cleanup()
data := testData()
diff --git a/services/internal/binarylib/perms_test.go b/services/internal/binarylib/perms_test.go
index b627b1a..b9f0e39 100644
--- a/services/internal/binarylib/perms_test.go
+++ b/services/internal/binarylib/perms_test.go
@@ -13,7 +13,6 @@
"v.io/v23"
"v.io/v23/context"
- "v.io/v23/naming"
"v.io/v23/security"
"v.io/v23/security/access"
"v.io/v23/services/repository"
@@ -83,7 +82,6 @@
func TestBinaryCreateAccessList(t *testing.T) {
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
selfCtx, err := v23.WithPrincipal(ctx, testutil.NewPrincipal("self"))
if err != nil {
@@ -138,7 +136,6 @@
func TestBinaryRootAccessList(t *testing.T) {
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
selfPrincipal := testutil.NewPrincipal("self")
selfCtx, err := v23.WithPrincipal(ctx, selfPrincipal)
@@ -422,7 +419,6 @@
func TestBinaryRationalStartingValueForGetPermissions(t *testing.T) {
ctx, shutdown := test.V23Init()
defer shutdown()
- v23.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
selfPrincipal := testutil.NewPrincipal("self")
selfCtx, err := v23.WithPrincipal(ctx, selfPrincipal)
diff --git a/test/init.go b/test/init.go
index 0dc5cf7..b8b6cc2 100644
--- a/test/init.go
+++ b/test/init.go
@@ -95,6 +95,8 @@
panic(err)
}
}
+ ns := v23.GetNamespace(ctx)
+ ns.CacheCtl(naming.DisableCache(true))
if params.CreateMounttable {
disp, err := mounttablelib.NewMountTableDispatcher(ctx, "", "", "mounttable")
if err != nil {
@@ -104,9 +106,7 @@
if err != nil {
panic(err)
}
- ns := v23.GetNamespace(ctx)
ns.SetRoots(s.Status().Endpoints[0].Name())
- ns.CacheCtl(naming.DisableCache(true))
}
return ctx, shutdown
}