Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Fix Integration test
Browse files Browse the repository at this point in the history
Make sure the free disk space min is set to a very low value (100 bytes)
so that controller can actually find eligible stores.
  • Loading branch information
Aravind Srinivasan committed May 11, 2017
1 parent 2d4edaf commit 11b1aac
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions test/integration/base.go
Expand Up @@ -29,6 +29,10 @@ import (
"testing"
"time"

log "github.com/Sirupsen/logrus"
"github.com/pborman/uuid"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/uber/cherami-server/clients/metadata"
"github.com/uber/cherami-server/common"
"github.com/uber/cherami-server/common/configure"
Expand All @@ -40,11 +44,8 @@ import (
"github.com/uber/cherami-server/services/outputhost"
"github.com/uber/cherami-server/services/storehost"
"github.com/uber/cherami-server/test"

log "github.com/Sirupsen/logrus"
"github.com/pborman/uuid"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
thriftM "github.com/uber/cherami-thrift/.generated/go/metadata"
"github.com/uber/tchannel-go/thrift"
)

type (
Expand Down Expand Up @@ -129,9 +130,30 @@ func (tb *testBase) SetupSuite(t *testing.T) {

singletonTestBase.setupSuiteImpl(t)
singletonTestBase.SetUp(map[string]int{}, 1)
singletonTestBase.setupServiceConfig(t)
*tb = singletonTestBase
}

func (tb *testBase) setupServiceConfig(t *testing.T) {
cItem := &thriftM.ServiceConfigItem{
ServiceName: common.StringPtr("cherami-storehost"),
ServiceVersion: common.StringPtr("*"),
Sku: common.StringPtr("*"),
Hostname: common.StringPtr("*"),
ConfigKey: common.StringPtr("minfreediskspacebytes"),
ConfigValue: common.StringPtr("100"), // set to a very low value - 100 bytes for the test
}

req := &thriftM.UpdateServiceConfigRequest{ConfigItem: cItem}

ctx, cancel := thrift.NewContext(15 * time.Second)
defer cancel()

err := tb.mClient.UpdateServiceConfig(ctx, req)
tb.NoError(err)

}

func (tb *testBase) setupSuiteImpl(t *testing.T) {
tb.SetT(t)
tb.keyspace = "integration_test"
Expand Down Expand Up @@ -283,7 +305,7 @@ func (tb *testBase) SetUp(clusterSz map[string]int, numReplicas int) {
tb.Controllers[hostID] = ch
}

tappedServices := []string{common.InputServiceName, common.OutputServiceName, common.StoreServiceName}
tappedServices := []string{common.InputServiceName, common.OutputServiceName, common.StoreServiceName, common.FrontendServiceName}
for _, s := range tappedServices {
var ch *controllerhost.Mcp
for _, ch = range tb.Controllers {
Expand Down

0 comments on commit 11b1aac

Please sign in to comment.