Skip to content

Set the XDG_CACHE_HOME for tests #4572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Apr 27, 2025

This makes sure each test run is independent.

Makes the tests

  • iface-error-test-1
  • iface-th-test

less flaky locally. On my machine, these tests were consistently failing after the first successful execution (due to caching the hiedb afaict.)
Should not have any effect on the CI flakiness issue.

@fendor fendor force-pushed the fix/tests-xdg-cache-home branch from 1a34302 to 7df2e36 Compare April 27, 2025 13:54
@fendor fendor requested review from soulomoon and jhrcek April 27, 2025 14:26
Copy link
Collaborator

@soulomoon soulomoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But ghcide test is not running for this PR, do you know why it is skipped

@fendor
Copy link
Collaborator Author

fendor commented Apr 27, 2025

@fendor fendor requested a review from michaelpj as a code owner April 27, 2025 15:13
@fendor
Copy link
Collaborator Author

fendor commented Apr 27, 2025

Test failures all look genuine, so more investigation is required.

@fendor fendor requested a review from wz1000 as a code owner May 5, 2025 16:33
@fendor fendor force-pushed the fix/tests-xdg-cache-home branch from 3be9351 to 8dcd861 Compare May 7, 2025 16:53
then mkHomeModLocation dflags (pathToModuleName fp) fp
then mkHomeModLocation dflags mod fp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be causing long-path issues on windows.
I am unsure how relevant this still is... Anybody an idea?

reexported = Position 55 14 ; reexportedSig = getDocUri "Bar.hs" >>= \bar -> return [ExpectHoverText ["Bar", "Bar", "Haddock"], if ghcVersion >= GHC94 && ghcVersion < GHC910 then mkL bar 3 5 3 8 else mkL bar 3 0 3 14]
reexported = Position 55 14 ; reexportedSig = getDocUri "Bar.hs" >>= \bar -> return [ExpectHoverText ["Bar", "Bar", "Haddock"], mkL bar 3 0 3 14]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be caused by a race/inconsistency between serving a hover request based on hiedb and getting the information from an interface file.

@fendor fendor force-pushed the fix/tests-xdg-cache-home branch 2 times, most recently from 019575a to 6920cae Compare May 8, 2025 14:33
fendor and others added 3 commits May 11, 2025 17:04
This makes sure each test run is independent.

Makes the tests
* iface-error-test-1
* iface-th-test

less flaky locally.
Should not have any effect on the CI flakiness issue.

---

Fix test cases to work with the temporary `XDG_CACHE_HOME`

Some tests were launching additional HLS instances for the tests.
Fixed, which should make the test slightly faster.
Ghcide test infrastructure was refactored to depend on `hls-test-utils`.
@fendor fendor force-pushed the fix/tests-xdg-cache-home branch from 6920cae to 2a07a93 Compare May 11, 2025 15:04
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.

4 participants