diff --git a/apps/loggregator.go b/apps/loggregator.go index 1d8f0c7cd..0c1b0c61d 100644 --- a/apps/loggregator.go +++ b/apps/loggregator.go @@ -1,10 +1,11 @@ package apps import ( - "code.cloudfoundry.org/go-loggregator" - "code.cloudfoundry.org/go-loggregator/rpc/loggregator_v2" "context" "fmt" + + "code.cloudfoundry.org/go-loggregator" + "code.cloudfoundry.org/go-loggregator/rpc/loggregator_v2" . "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers" "net/http" @@ -110,20 +111,6 @@ var _ = AppsDescribe("loggregator", func() { Eventually(msgChan, Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(EnvelopeContainingMessageLike("Muahaha")), "To enable the logging & metrics firehose feature, please ask your CF administrator to add the 'doppler.firehose' scope to your CF admin user.") }) - - It("shows container metrics", func() { - appGuid := strings.TrimSpace(string(cf.Cf("app", appName, "--guid").Wait().Out.Contents())) - - noaaConnection := noaa.NewConsumer(getDopplerEndpoint(), &tls.Config{InsecureSkipVerify: Config.GetSkipSSLValidation()}, nil) - msgChan := make(chan *events.Envelope, 100000) - errorChan := make(chan error) - stopchan := make(chan struct{}) - go noaaConnection.Firehose(CATSRandomName("SUBSCRIPTION-ID"), getAdminUserAccessToken(), msgChan, errorChan, stopchan) - defer close(stopchan) - - Eventually(msgChan, 2*Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(NonZeroContainerMetricsFor(MetricsApp{AppGuid: appGuid, InstanceId: 0}))) - Eventually(msgChan, 2*Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(NonZeroContainerMetricsFor(MetricsApp{AppGuid: appGuid, InstanceId: 1}))) - }) }) Context("reverse log proxy", func() { diff --git a/windows/metrics.go b/windows/metrics.go index deae32f12..dcfc67afe 100644 --- a/windows/metrics.go +++ b/windows/metrics.go @@ -6,7 +6,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "github.com/cloudfoundry-incubator/cf-test-helpers/cf" "github.com/cloudfoundry-incubator/cf-test-helpers/helpers" @@ -14,6 +13,8 @@ import ( "github.com/cloudfoundry/noaa" "github.com/cloudfoundry/noaa/events" + "time" + . "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers" "github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers" "github.com/cloudfoundry/cf-acceptance-tests/helpers/assets" @@ -22,7 +23,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" - "time" ) var _ = WindowsDescribe("Metrics", func() { @@ -64,20 +64,6 @@ var _ = WindowsDescribe("Metrics", func() { Eventually(msgChan, Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(EnvelopeContainingMessageLike("Muahaha")), "To enable the logging & metrics firehose feature, please ask your CF administrator to add the 'doppler.firehose' scope to your CF admin user.") }) - - It("shows container metrics", func() { - appGuid := strings.TrimSpace(string(cf.Cf("app", appName, "--guid").Wait().Out.Contents())) - - noaaConnection := noaa.NewConsumer(getDopplerEndpoint(), &tls.Config{InsecureSkipVerify: Config.GetSkipSSLValidation()}, nil) - msgChan := make(chan *events.Envelope, 100000) - errorChan := make(chan error) - stopchan := make(chan struct{}) - go noaaConnection.Firehose(random_name.CATSRandomName("SUBSCRIPTION-ID"), getAdminUserAccessToken(), msgChan, errorChan, stopchan) - defer close(stopchan) - - Eventually(msgChan, 2*Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(NonZeroContainerMetricsFor(MetricsApp{AppGuid: appGuid, InstanceId: 0}))) - Eventually(msgChan, 2*Config.DefaultTimeoutDuration(), time.Millisecond).Should(Receive(NonZeroContainerMetricsFor(MetricsApp{AppGuid: appGuid, InstanceId: 1}))) - }) }) type cfHomeConfig struct {