Skip to content

Commit b885622

Browse files
committed
tests: integration: Add a test case for quarantine case of out_s3
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent d099f52 commit b885622

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
service:
2+
flush: 1
3+
grace: 3
4+
log_level: info
5+
http_server: on
6+
http_port: ${FLUENT_BIT_HTTP_MONITORING_PORT}
7+
8+
pipeline:
9+
inputs:
10+
- name: dummy
11+
tag: out_s3_retry_exhausted
12+
dummy: '{"message":"retry exhausted default quarantine","source":"dummy"}'
13+
samples: 1
14+
15+
outputs:
16+
- name: s3
17+
match: out_s3_retry_exhausted
18+
bucket: test-bucket
19+
region: us-east-1
20+
endpoint: http://127.0.0.1:1
21+
use_put_object: true
22+
retry_limit: 1
23+
total_file_size: 1M
24+
upload_timeout: 1s
25+
s3_key_format: /payloads/$TAG/$UUID
26+
content_type: application/x-ndjson
27+
store_dir: /tmp/fluent-bit-test-suite-s3-retry-exhausted
28+
store_dir_limit_size: 20M

tests/integration/scenarios/out_s3/tests/test_out_s3_001.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import gzip
22
import json
33
import os
4+
import glob
5+
import time
46

57
import requests
68
import pytest
@@ -218,3 +220,22 @@ def test_out_s3_otlp_json_uploads_signal_payloads(signal_type, json_file, root_k
218220

219221
rendered = json.dumps(payload)
220222
assert expected_value in rendered
223+
224+
225+
def test_out_s3_default_retry_exhausted_action_quarantines_file():
226+
store_dir = "/tmp/fluent-bit-test-suite-s3-retry-exhausted"
227+
if os.path.exists(store_dir):
228+
for path in glob.glob(f"{store_dir}/**", recursive=True):
229+
if os.path.isfile(path):
230+
try:
231+
os.remove(path)
232+
except OSError:
233+
pass
234+
235+
service = Service("out_s3_retry_exhausted_default_quarantine.yaml")
236+
service.start()
237+
time.sleep(6)
238+
service.stop()
239+
240+
files = [p for p in glob.glob(f"{store_dir}/**", recursive=True) if os.path.isfile(p)]
241+
assert len(files) > 0

0 commit comments

Comments
 (0)