Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x-pack/filebeat/input/cometd/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func (in *cometdInput) Run() {
in.workerOnce.Do(func() {
in.workerWg.Add(1)
go func() {
in.log.Info("Input worker has started.")
defer in.log.Info("Input worker has stopped.")
defer in.workerWg.Done()
defer in.workerCancel()
in.log.Info("Input worker has started.")
defer in.log.Info("Input worker has stopped.")
in.b = bay.Bayeux{}

rt := rate.NewLimiter(rate.Every(retryInterval), 1)
Expand Down
12 changes: 6 additions & 6 deletions x-pack/filebeat/input/cometd/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ func newTestServer(URL string, handler http.Handler) (*httptest.Server, error) {
}

func TestNegativeCases(t *testing.T) {
t.Skip("https://github.com/elastic/beats/issues/47698")
expectedHTTPEventCount = 1
defer atomic.StoreUint64(&called, 0)
eventsCh := make(chan beat.Event)
Expand Down Expand Up @@ -582,13 +581,14 @@ func TestNegativeCases(t *testing.T) {
require.NotNil(t, input)

input.Run()
go func() {
<-eventsCh
assert.Error(t, fmt.Errorf("there should be no events"))
}()

// wait for run to return error or event
time.Sleep(100 * time.Millisecond)
select {
case <-eventsCh:
t.Error("expected no events, but received one")
case <-time.After(100 * time.Millisecond):
// Expected: no events received.
}

input.Stop()
}
Expand Down