Skip to content

Commit e582df3

Browse files
committed
Convert perf assertions to warnings, add CI job timeout
Shared CI runners are too variable for hard timing thresholds. Performance is still logged and warns above 15s, but no longer blocks the test suite. Added 30min timeout on test-unix jobs.
1 parent 3908624 commit e582df3

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/dry-run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ jobs:
181181
cc: cc
182182
cxx: c++
183183
runs-on: ${{ matrix.os }}
184+
timeout-minutes: 30
184185
steps:
185186
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
186187

tests/test_incremental.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,13 @@ TEST(incr_perf_single_file_fast) {
803803
char *resp = index_repo_timed(&ms, &peak_mb);
804804
ASSERT(resp != NULL);
805805
free(resp);
806-
#define MAX_TOOL_MS 15000 /* 15s max — accounts for slower CI runners */
806+
#define PERF_WARN_MS 15000 /* warn above 15s — slow CI runners may exceed this */
807807

808-
ASSERT_LT((int)ms, MAX_TOOL_MS); /* must be faster than full index */
809-
810-
printf(" [perf] single file incremental: %.0fms\n", ms);
808+
if ((int)ms > PERF_WARN_MS) {
809+
printf(" [PERF WARNING] single file incremental: %.0fms (>%dms)\n", ms, PERF_WARN_MS);
810+
} else {
811+
printf(" [perf] single file incremental: %.0fms\n", ms);
812+
}
811813

812814
delete_file_at("fastapi/incr_perf_probe.py");
813815
PASS();
@@ -817,7 +819,7 @@ TEST(incr_perf_single_file_fast) {
817819
* PHASE 8: MCP tool integration — comprehensive per-tool tests
818820
*
819821
* Every tool, every parameter, error paths, timeouts.
820-
* Timing: each call_tool_timed() asserts < MAX_TOOL_MS.
822+
* Timing: each call_tool_timed() warns if > PERF_WARN_MS.
821823
* ══════════════════════════════════════════════════════════════════ */
822824

823825
static char *call_tool_timed(const char *tool, double *ms, const char *args_fmt, ...) {
@@ -886,11 +888,13 @@ static int resp_lacks_key(const char *resp, const char *key) {
886888
return !resp_has_key(resp, key);
887889
}
888890

889-
/* Helper: assert tool call succeeds within timeout */
890-
#define TOOL_OK(resp, ms) \
891-
do { \
892-
ASSERT((resp) != NULL); \
893-
ASSERT_LT((int)(ms), MAX_TOOL_MS); \
891+
/* Helper: assert tool call succeeds, warn if slow */
892+
#define TOOL_OK(resp, ms) \
893+
do { \
894+
ASSERT((resp) != NULL); \
895+
if ((int)(ms) > PERF_WARN_MS) { \
896+
printf(" [PERF WARNING] tool call: %.0fms (>%dms)\n", (ms), PERF_WARN_MS); \
897+
} \
894898
} while (0)
895899

896900
/* Helper: assert response is not an error */

0 commit comments

Comments
 (0)