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

Failed test case with a ~70Kb input line, reading standard output: bufio.Scanner: token too long #169

Closed
apple-corps opened this issue Dec 7, 2021 · 1 comment

Comments

@apple-corps
Copy link

apple-corps commented Dec 7, 2021

I have an input line about ~70Kb long. Perhaps a little longer after escaping quotes for the JSON syntax. I fail my test cases but the output seems a little odd.

Then looking at the debugging output from LFV2 beta:

reading standard output: bufio.Scanner: token too long
stdout scanner closed unexpectedly
state change: "running_test" -> "unknown" by "crash"
exit stdout scanner
failed to wait for Logstash results: shutdown while waiting for state: ready_for_test
broadcast shutdown for waitForState
shutdown log reader

Then I think the bufio Scanner is likely in https://github.com/magnusbaeck/logstash-filter-verifier/blob/master/internal/logstash/eventreader.go or https://github.com/magnusbaeck/logstash-filter-verifier/blob/master/internal/daemon/instance/logstash/processors.go

I'm not a go programmer but can the token size be made configurable for users who want to test longer log sizes which might be closer to their use?

@breml
Copy link
Collaborator

breml commented Dec 10, 2021

Here we hit the default bufio.MaxScanTokenSize defined in the Go Stdlib, which is defined as 64KB.

It is possible to increase the size of this buffer, but is it really necessary? In order to keep the tests maintainable, I feel like having test cases with 70KB of input is no longer maintainable. Wouldn't it be possible to test the correct behavior of the Logstash config with smaller inputs?

breml added a commit to breml/logstash-filter-verifier that referenced this issue Dec 20, 2021
breml added a commit to breml/logstash-filter-verifier that referenced this issue Dec 20, 2021
@breml breml closed this as completed in 0293386 Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants