Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-pack/filebeat/input/httpjson: re-enable previously flakey first_event test #36525

Merged
merged 1 commit into from
Sep 7, 2023

Commits on Sep 6, 2023

  1. x-pack/filebeat/input/httpjson: re-enable previously flakey first_eve…

    …nt test
    
    With the change from concurrent to sequential processing this test is
    no longer flakey. This is confirmed by re-applying a delay to the
    publication of the first event in a set of events. This change causes
    the concurrent code to fail consistently, but the current sequential
    code passes.
    
    The test change used to test the flake is
    
    diff --git a/x-pack/filebeat/input/httpjson/request.go b/x-pack/filebeat/input/httpjson/request.go
    index 6a1d926ab4..3ed904f16d 100644
    --- a/x-pack/filebeat/input/httpjson/request.go
    +++ b/x-pack/filebeat/input/httpjson/request.go
    @@ -16,6 +16,7 @@ import (
            "reflect"
            "strconv"
            "strings"
    +       "time"
    
            "github.com/PaesslerAG/jsonpath"
    
    @@ -741,6 +742,10 @@ func newPublisher(trCtx *transformContext, pub inputcursor.Publisher, publish bo
     }
    
     func (p *publisher) event(_ context.Context, msg mapstr.M) {
    +       if p.n == 0 {
    +               time.Sleep(10 * time.Millisecond)
    +       }
    +
            if p.pub != nil {
                    event, err := makeEvent(msg)
                    if err != nil {
    efd6 committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    9b42b47 View commit details
    Browse the repository at this point in the history