test(observability): await measured recovery and verify store persistence
This commit is contained in:
@@ -115,3 +115,33 @@ def test_http_metrics_use_route_template_and_bounded_method(
|
||||
assert sensitive not in json.dumps(logs, default=str)
|
||||
assert sensitive not in str(exporter.get_finished_spans()[0].attributes)
|
||||
assert sensitive not in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_large_tracestate_cannot_break_durable_job_contract(signals):
|
||||
from datetime import UTC, datetime
|
||||
from uuid import uuid4
|
||||
|
||||
from src.pipeline import validate_job
|
||||
|
||||
trace_id = uuid4().hex
|
||||
incoming = {
|
||||
"traceparent": "00-" + trace_id + "-" + uuid4().hex[:16] + "-01",
|
||||
"tracestate": ",".join(
|
||||
"vendor" + str(i) + "=" + "x" * 200 for i in range(3)
|
||||
),
|
||||
}
|
||||
with telemetry.span("upload", parent=incoming):
|
||||
retained = telemetry.carrier()
|
||||
message = {
|
||||
"schema_version": 1,
|
||||
"job_id": str(uuid4()),
|
||||
"type": "attachment.process.v1",
|
||||
"attachment_id": str(uuid4()),
|
||||
"pipeline_version": 1,
|
||||
"attempt": 1,
|
||||
"created_at": datetime.now(UTC).isoformat(),
|
||||
**retained,
|
||||
}
|
||||
assert validate_job(message) == message
|
||||
assert retained["traceparent"].split("-")[1] == trace_id
|
||||
assert "tracestate" not in retained
|
||||
|
||||
Reference in New Issue
Block a user