func (s *StoreHostSuite) TeardownSuite() {
	s.testBase.cleanup()
	os.RemoveAll(s.baseDir)
	log.SetLevel(log.GetLevel())
}
TeardownSuite is called after all the test in the suite are run
package storehost
import (
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"math"
	"math/rand"
	"os"
	"sync/atomic"
	"testing"
	"time"
	"unsafe"
	metadataClient "github.com/uber/cherami-server/clients/metadata"
	"github.com/uber/cherami-server/common"
	"github.com/uber/cherami-server/common/configure"
	dconfig "github.com/uber/cherami-server/common/dconfigclient"
	"github.com/uber/cherami-server/test"
	mockmeta "github.com/uber/cherami-server/test/mocks/metadata"
	"github.com/uber/cherami-thrift/.generated/go/cherami"
	"github.com/uber/cherami-thrift/.generated/go/metadata"
	"github.com/uber/cherami-thrift/.generated/go/store"
	"github.com/pborman/uuid"
	log "github.com/sirupsen/logrus"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/require"
	"github.com/stretchr/testify/suite"
	"github.com/uber/tchannel-go/thrift"
)
var runLong = flag.Bool("long", false, "do a long run")                              
var logLevel = flag.String("log", "", "enabling stdout logging at specified level")  
var enablePerMessageLogs = flag.Bool("msg", false, "enable per message logs")        
var testStore = ManyRocks
var testDestinationUUID = "00000000-0000-0000-0000-000000000000"
var testConsumerGroupUUID = "11111111-1111-1111-1111-111111111111"
const randBufSize = 64 * 1048576  
var randBuf = make([]byte, randBufSize)
type (
	StoreHostSuite struct {
		*require.Assertions  
		suite.Suite
		cfg configure.CommonAppConfig
		metadataClient.TestCluster
		testBase   *testBase
		storehost0 *testStoreHost
		storehost1 *testStoreHost
		baseDir    string
	}
	testStoreHost struct {
		hostID    uuid.UUID
		storehost *StoreHost
		hostPort  string
		port      int
		wsPort    int
	}
	testBase struct {
		hwInfoReader common.HostHardwareInfoReader
		uuidResolver *mockUUIDResolver
		mClient      *mockmeta.TChanMetadataService
		baseDir     string
		ringhosts   string
		listenHosts map[string]string
		storehosts  []*testStoreHost
	}
)
func TestStoreHostSuite(t *testing.T) {
	suite.Run(t, new(StoreHostSuite))
}
func (s *StoreHostSuite) RunShort() bool {
	return testing.Short()
}
func (s *StoreHostSuite) RunLong() bool {
	return *runLong
}
func (s *StoreHostSuite) SetupSuite() {
	s.Assertions = require.New(s.T())  
	s.TestCluster.SetupTestCluster()
	s.cfg = common.SetupServerConfig(configure.NewCommonConfigure())
	if *logLevel != "" {
		log.SetOutput(os.Stdout)  
		switch *logLevel {
		case "debug":
			log.SetLevel(log.DebugLevel)
		case "info":
			log.SetLevel(log.InfoLevel)
		case "error":
			log.SetLevel(log.ErrorLevel)
		}
	}
	testBaseDir, _ := ioutil.TempDir("", "storehost-test")
	s.testBase = newTestBase(testBaseDir)
	s.storehost0 = s.testBase.newTestStoreHost(testStore)
	s.storehost1 = s.testBase.newTestStoreHost(testStore)
	time.Sleep(1250 * time.Millisecond)
	s.baseDir = testBaseDir
	rand.Read(randBuf)  
}
func newTestBase(baseDir string) *testBase {
	t := &testBase{
		baseDir:      baseDir,
		uuidResolver: newMockUUIDResolver(),
		hwInfoReader: newMockHostInfoReader(),
		mClient:      new(mockmeta.TChanMetadataService),
	}
	t.mClient.On("RegisterHostUUID", mock.Anything, mock.Anything).Return(nil)
	t.mClient.On("UpdateStoreExtentReplicaStats", mock.Anything, mock.Anything).Return(nil)
	t.mClient.On("ListStoreExtentsStats", mock.Anything, mock.Anything).Return(metadata.NewListStoreExtentsStatsResult_(), nil)
	return t
}
func (t *testBase) newTestStoreHost(store Store) *testStoreHost {
	hostID := uuid.NewRandom()
	hostPort, listenIP, port, _ := test.FindEphemeralPort()
	if t.listenHosts == nil {
		t.listenHosts = map[string]string{common.StoreServiceName: hostPort}
		t.ringhosts = hostPort
	}
	t.uuidResolver.Set(hostID.String(), hostPort)
	cfg := &configure.ServiceConfig{
		Port:          port,
		RingHosts:     t.ringhosts,
		LimitsEnabled: false,
		ListenAddress: listenIP,
	}
	reporter := common.NewMetricReporterWithHostname(configure.NewCommonServiceConfig())
	dClient := dconfig.NewDconfigClient(configure.NewCommonServiceConfig(), common.StoreServiceName)
	sCommon := common.NewService(common.StoreServiceName, hostID.String(), cfg, t.uuidResolver, t.hwInfoReader, reporter, dClient, common.NewBypassAuthManager())
	storehost, tc := NewStoreHost(common.StoreServiceName, sCommon, t.mClient, &Options{Store: store, BaseDir: t.baseDir})
	storehost.Start(tc)
	_, _, wsPort, _ := test.FindEphemeralPort()
	common.WSStart(``, wsPort, storehost)  
	sh := &testStoreHost{
		hostID:    hostID,
		hostPort:  hostPort,
		port:      port,
		storehost: storehost,
		wsPort:    wsPort,
	}
	t.storehosts = append(t.storehosts, sh)
	return sh
}
func (t *testBase) cleanup() {
	for _, sh := range t.storehosts {
		sh.storehost.Shutdown()
		sh.storehost.Stop()
	}
}