Skip to content

Commit

Permalink
add: tests for probe budgets
Browse files Browse the repository at this point in the history
  • Loading branch information
tylfin committed Jan 29, 2025
1 parent 85e0541 commit 438adb4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/debugger/probes/probe_snapshot_log_line_budgets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"language": "",
"type": "",
"id": "log170aa-acda-4453-9111-1478a697line",
"version": 0,
"where": {
"typeName": null,
"sourceFile": "ACTUAL_SOURCE_FILE",
"lines": [
"141"
]
}
}

]
11 changes: 11 additions & 0 deletions tests/debugger/test_debugger_probe_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,14 @@ def test_code_origin_entry_present(self):
code_origins_entry_found = code_origin_type == "entry"

assert code_origins_entry_found

def setup_log_line_probe_snaphots_budgets(self):
self._setup("probe_snapshot_log_line_budgets", "/debugger/budgets/5000")

@missing_feature(context.library != "python", reason="Not yet implemented")
def test_log_line_probe_snaphots_budgets(self):
self._assert()
self._validate_snapshots()

for _id in self.probe_ids:
assert len(self.probe_snapshots[_id]) <= 100
6 changes: 6 additions & 0 deletions utils/build/docker/python/flask/debugger_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ def nulls():
pii = Pii()

return f"Pii is null {pii is None}. intValue is null {intValue is None}. strValue is null {strValue is None}."

@debugger_blueprint.route("/budgets/<int:loops>", methods=["GET"])
def budgets(loops):
for _ in range(loops):
pass
return "Budgets", 200

0 comments on commit 438adb4

Please sign in to comment.