Why Rally extract 1001 docs in --test-mode?

Hey there,
extracting a custom track from an existing cluster I faced a strange behaviour. Rally extracts 1001 docs while it should extract exactly 1000 docs.
When I try to import it with the flag --test-mode I get this error:

[ERROR] Cannot race. Error in track preparator
Data in [/rally/tracks/index-documents-1k.json] for track [tracks] are invalid. Expected [1000] lines but got [1001].

I have to open manually the json file and remove the latest document. After that it works.

Is it a bug or anything else?

Hm, this does sound like a bug. what does esrally --version show?

esrally 2.2.1
I tried also with esrally 2.1.0, result is the same.

I am using docker image

I confirmed this is a bug. Raised Wrong amount of docs for test corpora when creating a track with create-track · Issue #1317 · elastic/rally · GitHub and will raise a fix PR soon.

1 Like

I am happy to have found out :grinning_face_with_smiling_eyes: :face_with_monocle:

I raised this PR fixing the issue Fix num of docs in -1k generated corpus by dliappis · Pull Request #1318 · elastic/rally · GitHub