Skip to content

fix(tests,registry): outdated language test-list + cache overwrite tiebreak bug - #233

Merged
Wolfvin merged 1 commit into
mainfrom
fix/node-types-language-list-and-cache-tiebreak
Jul 12, 2026
Merged

fix(tests,registry): outdated language test-list + cache overwrite tiebreak bug#233
Wolfvin merged 1 commit into
mainfrom
fix/node-types-language-list-and-cache-tiebreak

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Found via comparing full test-suite results against a clean baseline (commit c722f4a, before this session).

  1. test_node_types.pyEXPECTED_LANGUAGES only listed the original 7 languages; issue feat(languages): add Go, Java, PHP, Ruby, C/C++ tree-sitter support #198 added 6 more (go/java/php/ruby/c/cpp) without updating this test. The failure message literally said "Update EXPECTED_LANGUAGES in this test."

  2. persistent_registry.pyget_cached_result() ordered by timestamp DESC LIMIT 1 only. Since set_cached_result() does a plain INSERT (not upsert), two writes for the same cache key in quick succession can land on the same time.time() value, making the ORDER BY tie resolve arbitrarily — sometimes returning the stale row. Fix: add id DESC (monotonic autoincrement) as tiebreaker.

Verified: test_node_types.py 32 passed. test_persistent_registry_extra.py 26 passed (was 24 passed, 2 failed).

@Wolfvin
Wolfvin merged commit bdfd277 into main Jul 12, 2026
@Wolfvin
Wolfvin deleted the fix/node-types-language-list-and-cache-tiebreak branch July 12, 2026 05:37
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…ebreak bug

1. tests/test_node_types.py: EXPECTED_LANGUAGES only listed the original 7
   languages (python/rust/js/ts/tsx/css/html). Issue #198 added 6 more
   (go/java/php/ruby/c/cpp) to node_types.yaml, but this test wasn't
   updated — test_no_extra_languages_beyond_expected failed with an
   explicit 'Update EXPECTED_LANGUAGES in this test' message pointing at
   its own staleness. Updated the set to all 13 current languages.

2. scripts/persistent_registry.py: get_cached_result() ordered by
   'timestamp DESC LIMIT 1' only. set_cached_result() does a plain INSERT
   (not an upsert), so two writes for the same (command, file_set_hash)
   key in quick succession can land on the same time.time() value
   (limited clock resolution) -- the ORDER BY tie then resolves
   arbitrarily, sometimes returning the stale row instead of the newest.
   Found via baseline comparison: test_overwrite_frontend/test_overwrite_backend
   in test_persistent_registry_extra.py failed intermittently on this
   exact pattern (store 'old', store 'new', load should return 'new').
   Fix: add 'id DESC' (autoincrement, monotonic) as a tiebreaker.

Both found via comparing today's full test-suite failures against a clean
baseline (commit c722f4a, before this session's work) -- confirmed these
are test-debt from other legitimate changes this session, not regressions
introduced by unrelated code.

Verified: tests/test_node_types.py 32 passed. tests/test_persistent_registry_extra.py
26 passed (was 24 passed, 2 failed).
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant