Skip to content

Fix Windows test failures from PR #201 - #202

Merged
prabhu merged 2 commits into
mainfrom
feat/js-frontend-frameworks
Oct 12, 2026
Merged

prabhu merged 2 commits into
mainfrom
feat/js-frontend-frameworks

Conversation

@prabhu

@prabhu prabhu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #201 (merged before its Windows legs finished, since only pr-tests (ubuntu-latest, 25) was a required check at the time). Two fixes:

jssrc2cpg: expect / project-relative names in the $lib import tests on every OS

SvelteKitAliasImportTests still built its expectations with File.separator, but #101's commits a255183c and 55d895e4 made method full names carry / project-relative names on every OS, so the two resolution tests failed on every Windows job:

"src/lib/api.js::program:getArticle" did not include substring "src\lib\api.js"

js tags: scope JsIndexes' assignment index by graph

A node's equals/hashCode cover its id only, never its graph, and every CPG numbers its nodes from the same range, so the static WeakHashMap[Method, ...] matched methods across CPGs built in the same JVM. One test's assignment map then served another's lookup:

  • with the foreign graph still open, a local resolved to the previous test's expression and EasyTagsPass tagged xhr.send and seen.delete as SDK actions — the intermittent JsDomRecognizerTest failure seen on CI (Windows/JVM 26 on the PR build, macOS/JVM 23 on the merge-group build);
  • with the graph closed, accesses threw MVStoreException: This store is closed.

The index is now keyed by graph first (as methodIndexes already was), making the inner by-node key exact since ids are unique within a graph. Verified with a 30-round close/reopen stress loop (previously failed from round 2) plus full suites: x2cpg 136 and jssrc2cpg 679 tests green.

Branch protection on main now requires one pr-tests leg per OS (ubuntu/windows/macos, JVM 25), so the queue can no longer merge while another OS is failing.

…n every OS

The $lib tests still built their expectations with File.separator, but
a255183 and 55d895e made method full names carry / project-relative
names on every OS, so the two resolution tests failed on Windows.
A node's equals/hashCode cover its id only, never its graph, and every
CPG numbers its nodes from the same range, so the static
WeakHashMap[Method, ...] matched methods across CPGs built in the same
JVM. One test's assignment map then served another's lookup: with the
foreign graph still open, a local resolved to the previous test's
expression and EasyTagsPass tagged xhr.send and seen.delete as SDK
actions (the intermittent JsDomRecognizerTest failure on CI); with the
graph closed, accesses threw MVStoreException. Key the index by graph
first, as methodIndexes already is - within one graph ids are unique,
so the inner by-node key is exact.
@prabhu
prabhu added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit d31385f Oct 12, 2026
@prabhu
prabhu deleted the feat/js-frontend-frameworks branch October 12, 2026 20:47
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