Skip to content

Commit 0b80d1e

Browse files
committed
[test] updated test on overflow of fixed 'decode_size_limit_bytes' to not raise an error bu create an Event, tag it appropriately and slice the offending data into 'message' field
1 parent f4e4e00 commit 0b80d1e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/codecs/json_lines_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@
127127
subject.decode(maximum_payload)
128128
}.not_to raise_error
129129
end
130+
131+
it "should raise an error if the max bytes are exceeded" do
132+
subject.decode(maximum_payload << "z") do |event|
133+
expect(event.get("tags")).to include("_jsonparse_too_big_failure")
134+
expect(event.get("message").size).to eq(decode_size_limit_bytes)
135+
end
136+
end
130137

131138
it "should raise an error if the max bytes are exceeded" do
132139
expect {

0 commit comments

Comments
 (0)