Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 {
- Loading branch information