|
14 | 14 | import tempfile |
15 | 15 | import unittest |
16 | 16 |
|
17 | | -from hypothesis import given, settings |
| 17 | +from hypothesis import HealthCheck, given, settings |
18 | 18 | from hypothesis import strategies as st |
19 | 19 |
|
20 | 20 | REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
26 | 26 | classify_blob_data, |
27 | 27 | messages_to_bubbles, |
28 | 28 | traverse_blobs, |
29 | | - _extract_blob_refs, |
| 29 | + _extract_blob_refs, # internal helper; covered directly alongside classify_blob_data |
30 | 30 | ) |
31 | 31 | from utils.text_extract import extract_text_from_bubble |
32 | 32 |
|
|
76 | 76 |
|
77 | 77 |
|
78 | 78 | @st.composite |
79 | | -def _cli_message(draw) -> dict: |
| 79 | +def _cli_message(draw): |
80 | 80 | # Empty role is intentional adversarial input (unknown / missing role). |
81 | 81 | role = draw(st.sampled_from(["user", "assistant", "system", "tool", ""])) |
82 | 82 | content = draw( |
@@ -142,7 +142,12 @@ def _build_store_db_raw(path: str, meta: dict, blobs: dict[str, bytes]) -> None: |
142 | 142 |
|
143 | 143 |
|
144 | 144 | def _assemble_workspace_bubble(bubble_id: object, value: object) -> dict | None: |
145 | | - """Mirror workspace_tabs KV bubble load (json.loads → Bubble.from_dict).""" |
| 145 | + """Mirror workspace_tabs KV bubble load (json.loads → Bubble.from_dict). |
| 146 | +
|
| 147 | + Intentionally re-implements the conversion instead of importing |
| 148 | + ``_loads_kv_value_logged`` (logging / payload hashing side effects). |
| 149 | + Keep in sync with the bubbleId load loop in ``services/workspace_tabs.py``. |
| 150 | + """ |
146 | 151 | try: |
147 | 152 | if value is None: |
148 | 153 | return None |
@@ -246,10 +251,15 @@ def test_classify_blob_data_never_raises(self, data: bytes) -> None: |
246 | 251 | extra_ids=st.lists(_BLOB_ID_HEX, max_size=6, unique=True), |
247 | 252 | payloads=st.lists(st.binary(max_size=1024), min_size=1, max_size=8), |
248 | 253 | ) |
249 | | - @settings(max_examples=40, deadline=None) |
| 254 | + @settings( |
| 255 | + max_examples=40, |
| 256 | + deadline=None, |
| 257 | + suppress_health_check=[HealthCheck.too_slow], |
| 258 | + ) |
250 | 259 | def test_traverse_blobs_never_raises( |
251 | 260 | self, root_id: str, extra_ids: list[str], payloads: list[bytes] |
252 | 261 | ) -> None: |
| 262 | + # CliSessionMeta only requires latestRootBlobId (str); BFS runs after meta parse. |
253 | 263 | meta = {"latestRootBlobId": root_id, "createdAt": 1_700_000_000_000} |
254 | 264 | blobs: dict[str, bytes] = {root_id: payloads[0]} |
255 | 265 | for i, bid in enumerate(extra_ids): |
|
0 commit comments