Skip to content

Fix flaky rename test - #91

Merged
JesseHerrick merged 2 commits into
mainfrom
fix-flaky-rename-test
Sep 7, 2026
Merged

Fix flaky rename test#91
JesseHerrick merged 2 commits into
mainfrom
fix-flaky-rename-test

Conversation

@JesseHerrick

Copy link
Copy Markdown
Member

No description provided.

JesseHerrick and others added 2 commits September 7, 2026 17:26
TestRename_Module_FileRenameLastSegmentOnly/from_caller_via_alias failed
on CI but passed locally. It reproduces with GOMAXPROCS=1, which is what
a loaded runner does to goroutine scheduling.

The first subtest renames from the file the editor owns, so the server
hands the move to the client and reindexAfterRename queues a removal of
the old path from the index — correct, because the client now owns that
path. That removal runs on a background goroutine. The second subtest
re-indexes the same path to restore the fixture without waiting for it,
so when the goroutine wins the race it deletes the definition the second
subtest needs. RenameEdit then finds no module def, returns (nil, nil)
without an error, and nothing moves the file.

Wait for the background work before restoring the fixture, and restore
the caller file too — the first subtest rewrites it on disk, since it is
closed.

60 runs at GOMAXPROCS=1 are clean; before this the failure rate was
about 25%.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Formatter tests need mix on PATH and skip themselves without it, and the
test/test-race jobs have no Elixir, so test-integration is the only job
that runs them. Its -run filter named six tests, which left eight
running nowhere at all:

  TestFormatterServer_HEEXPluginFormatsSigilsAndFiles
  TestFormatterServer_NonStandardOptionReachesPlugin
  TestFormatterServer_PluginCanCallMixProjectConfig
  TestFormatterServer_UmbrellaStylerPlugin
  TestFormatter_PersistentProcessReuse
  TestFormatter_RestartAfterCrash
  TestDidSave_FormatterConfigRestartPicksUpUpdatedConfig
  TestFormatter_ExternalFormatterConfigChangePicksUpUpdatedConfig

Match the family instead. A hand-maintained list silently stops covering
each test added outside it, and go test -run does not complain when a
pattern matches nothing — the old filter still named
TestFormatterServer_CacheInvalidation, which no longer exists.

All 18 tests pass with no skips, in 21s locally; the timeout goes to
600s for the larger set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JesseHerrick
JesseHerrick merged commit df331e3 into main Sep 7, 2026
4 checks passed
@JesseHerrick
JesseHerrick deleted the fix-flaky-rename-test branch September 7, 2026 21:51
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