Skip to content

Commit 96820b0

Browse files
dpageclaude
andcommitted
Fix CI test failures in compaction and NLQ chat tests.
- Lower max_tokens budget in test_drops_low_value to reliably force compaction (500 was borderline, use 200). - Consume SSE response data before asserting mock calls in NLQ chat test, since Flask's streaming generator only executes on iteration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2c38e1 commit 96820b0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

web/pgadmin/llm/tests/test_compaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def test_drops_low_value(self):
159159
]
160160

161161
result = compact_history(
162-
messages, max_tokens=500, recent_window=2
162+
messages, max_tokens=200, recent_window=2
163163
)
164164

165165
# Should have fewer messages than original

web/pgadmin/tools/sqleditor/tests/test_nlq_chat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ def runTest(self):
162162
self.assertEqual(response.status_code, 200)
163163
self.assertIn('text/event-stream', response.content_type)
164164

165+
# Consume the SSE stream so the generator executes
166+
# fully (including the chat_with_database call)
167+
_ = response.data
168+
165169
# Verify history was passed to chat_with_database
166170
if hasattr(self, 'history') and mock_chat_obj:
167171
mock_chat_obj.assert_called_once()

0 commit comments

Comments
 (0)