v23: gosh/v23test: address gosh TODOs, update v23 code

MultiPart: 2/5
Change-Id: Ie220fef0497b43af36c5d897091402cf9b63590f
diff --git a/syncbase/featuretests/blob_v23_test.go b/syncbase/featuretests/blob_v23_test.go
index 8896f35..49f26f2 100644
--- a/syncbase/featuretests/blob_v23_test.go
+++ b/syncbase/featuretests/blob_v23_test.go
@@ -21,7 +21,8 @@
 )
 
 func TestV23BlobWholeTransfer(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
diff --git a/syncbase/featuretests/client_v23_test.go b/syncbase/featuretests/client_v23_test.go
index 9907ff4..c9c4e30 100644
--- a/syncbase/featuretests/client_v23_test.go
+++ b/syncbase/featuretests/client_v23_test.go
@@ -12,7 +12,8 @@
 )
 
 func TestV23SyncbasedPutGet(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
diff --git a/syncbase/featuretests/cr_v23_test.go b/syncbase/featuretests/cr_v23_test.go
index 9d64f4f..e5613f0 100644
--- a/syncbase/featuretests/cr_v23_test.go
+++ b/syncbase/featuretests/cr_v23_test.go
@@ -33,7 +33,8 @@
 // TODO(jlodhia): Add more rules based on value type and combination of key
 // prefix and value type once its implemented.
 func TestV23CRRuleConfig(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 10)
 
@@ -70,7 +71,8 @@
 // Result:
 // The value for foo0 after sync settles on what S1 wrote for both syncbases.
 func TestV23CRDefault(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 1)
 
@@ -113,7 +115,8 @@
 // After conflict resolution, final values for all rows within the batch must
 // come from either S0 or S1 but not a mixture of the two.
 func TestV23CRWithAtomicBatch(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 100)
 
@@ -150,7 +153,8 @@
 // 2) 5 rows written as a single batch on both syncbases resulting into a
 //    single conflict for the batch.
 func TestV23CRAppResolved(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 10)
 
@@ -200,7 +204,8 @@
 // Result:
 // All rows are resolved via AppResolves.
 func TestV23CRAppBasedResolutionOverridesOthers(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 20)
 
@@ -249,7 +254,8 @@
 	// conflict.
 	t.Skip()
 
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	client0Ctx, client1Ctx, sgName := setupCRTest(t, sh, 10)
 
diff --git a/syncbase/featuretests/restartability_v23_test.go b/syncbase/featuretests/restartability_v23_test.go
index d1b7263..4492849 100644
--- a/syncbase/featuretests/restartability_v23_test.go
+++ b/syncbase/featuretests/restartability_v23_test.go
@@ -55,7 +55,8 @@
 }
 
 func TestV23RestartabilityHierarchy(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -71,7 +72,8 @@
 // Same as TestV23RestartabilityHierarchy except the first syncbase is killed
 // with SIGKILL instead of SIGINT.
 func TestV23RestartabilityCrash(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -150,7 +152,8 @@
 }
 
 func TestV23RestartabilityQuiescent(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -185,7 +188,8 @@
 
 // A read-only batch should fail if the server crashes in the middle.
 func TestV23RestartabilityReadOnlyBatch(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -237,7 +241,8 @@
 
 // A read/write batch should fail if the server crashes in the middle.
 func TestV23RestartabilityReadWriteBatch(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -295,7 +300,8 @@
 }
 
 func TestV23RestartabilityWatch(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -408,7 +414,8 @@
 }
 
 func TestV23RestartabilityServiceDBCorruption(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -421,7 +428,7 @@
 
 	// TODO(ivanpi): Repeated below, refactor into method.
 	// Expect syncbase to fail to start.
-	syncbasedPath := sh.JiriBuildGoPkg("v.io/x/ref/services/syncbase/syncbased")
+	syncbasedPath := sh.BuildGoPkg("v.io/x/ref/services/syncbase/syncbased")
 	syncbased := sh.Cmd(syncbasedPath,
 		"--alsologtostderr=true",
 		"--v23.tcp.address=127.0.0.1:0",
@@ -430,7 +437,7 @@
 		"--root-dir="+rootDir)
 	syncbased = syncbased.WithCredentials(serverCreds)
 	syncbased.ExitErrorIsOk = true
-	stdout, stderr := syncbased.Output()
+	stdout, stderr := syncbased.StdoutStderr()
 	if syncbased.Err == nil {
 		t.Fatal("Expected syncbased to fail to start.")
 	}
@@ -444,7 +451,8 @@
 }
 
 func TestV23RestartabilityAppDBCorruption(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
@@ -456,7 +464,7 @@
 	corruptFile(t, rootDir, `apps/[^/]*/dbs/[^/]*/leveldb/.*\.log`)
 
 	// Expect syncbase to fail to start.
-	syncbasedPath := sh.JiriBuildGoPkg("v.io/x/ref/services/syncbase/syncbased")
+	syncbasedPath := sh.BuildGoPkg("v.io/x/ref/services/syncbase/syncbased")
 	syncbased := sh.Cmd(syncbasedPath,
 		"--alsologtostderr=true",
 		"--v23.tcp.address=127.0.0.1:0",
@@ -465,7 +473,7 @@
 		"--root-dir="+rootDir)
 	syncbased = syncbased.WithCredentials(serverCreds)
 	syncbased.ExitErrorIsOk = true
-	stdout, stderr := syncbased.Output()
+	stdout, stderr := syncbased.StdoutStderr()
 	if syncbased.Err == nil {
 		t.Fatal("Expected syncbased to fail to start.")
 	}
@@ -497,7 +505,8 @@
 	// TODO(ivanpi): Fully testing store garbage collection requires fault
 	// injection or mocking out the store.
 	// NOTE: Test assumes that leveldb destroy is implemented as 'rm -r'.
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	rootDir, clientCtx, serverCreds := restartabilityInit(sh)
 	cleanup := sh.StartSyncbase(serverCreds, testSbName, rootDir, acl)
diff --git a/syncbase/featuretests/syncgroup_v23_test.go b/syncbase/featuretests/syncgroup_v23_test.go
index b33bd9c..8f05151 100644
--- a/syncbase/featuretests/syncgroup_v23_test.go
+++ b/syncbase/featuretests/syncgroup_v23_test.go
@@ -25,7 +25,8 @@
 // when: all Syncbases are online and a creator creates the syncgroup and shares
 // the syncgroup name with all the joiners.
 func TestV23SyncgroupRendezvousOnline(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
@@ -66,7 +67,8 @@
 	// this test from succeeding.
 	t.Skip()
 
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
@@ -106,7 +108,8 @@
 // picking a syncgroup name that is not reachable and a syncgroup mount table
 // that doesn't exist.
 func TestV23SyncgroupNeighborhoodOnly(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
@@ -160,7 +163,8 @@
 // tries to join a syncgroup with a predetermined name, and if join fails,
 // creates the syncgroup.
 func TestV23SyncgroupPreknownStaggered(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
 
diff --git a/syncbase/featuretests/vclock_v23_test.go b/syncbase/featuretests/vclock_v23_test.go
index ebf7e99..202f6ed 100644
--- a/syncbase/featuretests/vclock_v23_test.go
+++ b/syncbase/featuretests/vclock_v23_test.go
@@ -14,7 +14,6 @@
 	"v.io/x/ref/lib/v23test"
 	"v.io/x/ref/services/syncbase/server/util"
 	tu "v.io/x/ref/services/syncbase/testutil"
-	"v.io/x/ref/test/expect"
 )
 
 const (
@@ -33,9 +32,11 @@
 
 // Tests that the virtual clock moves forward.
 func TestV23VClockMovesForward(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -52,9 +53,11 @@
 
 // Tests that system clock updates affect the virtual clock.
 func TestV23VClockSystemClockUpdate(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -109,9 +112,11 @@
 // Tests that the virtual clock daemon checks for system clock updates at the
 // expected frequency (loosely speaking).
 func TestV23VClockSystemClockFrequency(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -139,9 +144,11 @@
 // Tests that NTP sync affects virtual clock state (e.g. clock can move
 // backward).
 func TestV23VClockNtpUpdate(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -165,9 +172,11 @@
 
 // Tests that NTP skew persists across reboots.
 func TestV23VClockNtpSkewAfterReboot(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -202,9 +211,11 @@
 // Tests that the virtual clock daemon checks in with NTP at the expected
 // frequency (loosely speaking).
 func TestV23VClockNtpFrequency(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	ctx := sh.ForkContext("c0")
 	s0Creds := sh.ForkCredentials("s0")
 	sh.StartSyncbase(s0Creds, "s0", "", openPerms, "--dev")
@@ -241,9 +252,11 @@
 // Tests p2p clock sync where local is not NTP-synced and is 1, 2, or 3 hops
 // away from an NTP-synced device.
 func TestV23VClockSyncBasic(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	sbs := setupSyncbases(t, sh, 4, "--dev")
 
 	checkSbTimeNotEq(t, "s0", sbs[0].clientCtx, jan2015)
@@ -270,9 +283,11 @@
 
 // Tests p2p clock sync where multiple devices are NTP-synced.
 func TestV23VClockSyncWithLocalNtp(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	sbs := setupSyncbases(t, sh, 3, "--dev")
 
 	// Do NTP at s0 and s2.
@@ -322,9 +337,11 @@
 // Tests p2p clock sync where local is not NTP-synced and is 1 hop away from an
 // NTP-synced device with >0 reboots.
 func TestV23VClockSyncWithReboots(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	sbs := setupSyncbases(t, sh, 2, "--dev")
 
 	// Set s0's local clock.
@@ -394,13 +411,10 @@
 func startFakeNtpServer(t *testing.T, sh *v23test.Shell, now time.Time) string {
 	nowBuf, err := now.MarshalText()
 	ok(t, err)
-	ntpd := sh.JiriBuildGoPkg("v.io/x/ref/services/syncbase/testutil/fake_ntp_server")
-	inv := sh.Cmd(ntpd, "--now="+string(nowBuf))
-	// TODO(ivanpi): Use Session built into v23test.Shell when checked in.
-	// TODO(ivanpi): 1 second is potentially flaky, is it safe to bump?
-	exp := expect.NewSession(t, inv.StdoutPipe(), time.Second)
-	inv.Start()
-	host := exp.ExpectVar("HOST")
+	ntpd := sh.BuildGoPkg("v.io/x/ref/services/syncbase/testutil/fake_ntp_server")
+	c := sh.Cmd(ntpd, "--now="+string(nowBuf))
+	c.Start()
+	host := c.S.ExpectVar("HOST")
 	if host == "" {
 		t.Fatalf("fake_ntp_server failed to start")
 	}
diff --git a/syncbase/nosql/syncgroup_v23_test.go b/syncbase/nosql/syncgroup_v23_test.go
index eb969cf..23ba873 100644
--- a/syncbase/nosql/syncgroup_v23_test.go
+++ b/syncbase/nosql/syncgroup_v23_test.go
@@ -41,9 +41,11 @@
 // syncgroup at Syncbase1. Syncbase1 in turn requests Syncbase0 to join the
 // syncgroup.
 func TestV23SyncbasedJoinSyncgroup(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -69,9 +71,11 @@
 // the database entries.  This verifies the end-to-end synchronization of data
 // along the path: client0--Syncbase0--Syncbase1--client1.
 func TestV23SyncbasedGetDeltas(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -104,9 +108,11 @@
 // the path: client0--Syncbase0--Syncbase1--client1 with a workload of puts and
 // deletes.
 func TestV23SyncbasedGetDeltasWithDel(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -147,9 +153,11 @@
 // done, both Syncbase instances are shutdown and restarted, and new data is
 // synced once again.
 func TestV23SyncbasedCompEval(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	server0RDir := sh.MakeTempDir()
@@ -225,9 +233,11 @@
 // "foobar". The 2nd client then modifies the prefix acl at "foobar" with access
 // to both clients. The 1st client should regain access.
 func TestV23SyncbasedExchangeDeltasWithAcls(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -283,20 +293,20 @@
 // identical. Optionally we could expose inner state of syncbased via some
 // debug methods.
 func TestV23SyncbasedExchangeDeltasWithConflicts(t *testing.T) {
+	v23test.SkipUnlessRunningIntegrationTests(t)
+
 	// Run it multiple times to exercise different interactions between sync
 	// and local updates that change every run due to timing.
 	for i := 0; i < 10; i++ {
-		// TODO(ivanpi): hack: shell created here to satisfy requirement that
-		// NewShell for large tests is called directly from a TestV23* function.
-		sh := v23test.NewShell(t, v23test.Opts{Large: true})
-		defer sh.Cleanup()
-		testSyncbasedExchangeDeltasWithConflicts(t, sh)
-		sh.Cleanup()
+		testSyncbasedExchangeDeltasWithConflicts(t)
 	}
 }
 
-func testSyncbasedExchangeDeltasWithConflicts(t *testing.T, sh *v23test.Shell) {
+func testSyncbasedExchangeDeltasWithConflicts(t *testing.T) {
+	sh := v23test.NewShell(t, v23test.Opts{})
+	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -336,9 +346,11 @@
 // then joins the syncgroup with prefix "f" and verifies that it can read the
 // "f" keys.
 func TestV23NestedSyncgroups(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -375,9 +387,11 @@
 // keys created by client 1. Client 2 also verifies that it can read all the "f"
 // and "foo" keys created by client 1.
 func TestV23NestedAndPeerSyncgroups(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -422,9 +436,11 @@
 // syncgroup over that data.  The 2nd client joins that syncgroup and reads the
 // database entries.
 func TestV23SyncbasedGetDeltasPrePopulate(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -456,9 +472,11 @@
 // app databases then creates multiple syncgroups (one per database) over that
 // data.  The 2nd client joins these syncgroups and reads all the data.
 func TestV23SyncbasedGetDeltasMultiApp(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",
@@ -485,9 +503,11 @@
 // clients must learn of the remaining two. Note that client 2 relies on
 // syncgroup metadata syncing to learn of client 3 .
 func TestV23SyncgroupSync(t *testing.T) {
-	sh := v23test.NewShell(t, v23test.Opts{Large: true})
+	v23test.SkipUnlessRunningIntegrationTests(t)
+	sh := v23test.NewShell(t, v23test.Opts{})
 	defer sh.Cleanup()
 	sh.StartRootMountTable()
+
 	server0Creds := sh.ForkCredentials("s0")
 	client0Ctx := sh.ForkContext("c0")
 	sh.StartSyncbase(server0Creds, "sync0", "",