Skip to content

Commit

Permalink
Merge pull request #412 from cloudfoundry/remove_flaky_metrics_tests
Browse files Browse the repository at this point in the history
remove flaky metrics test
  • Loading branch information
jamespollard8 authored Mar 30, 2020
2 parents 5bc8b9c + f0bc40c commit 28d6fda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
19 changes: 3 additions & 16 deletions apps/loggregator.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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() {
Expand Down
18 changes: 2 additions & 16 deletions windows/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers"
"github.com/cloudfoundry-incubator/cf-test-helpers/workflowhelpers"
"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"
Expand All @@ -22,7 +23,6 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
"time"
)

var _ = WindowsDescribe("Metrics", func() {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 28d6fda

Please sign in to comment.