Skip to content
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

Fix Detekt tests #4019

Merged
merged 1 commit into from
Nov 24, 2024
Merged

Fix Detekt tests #4019

merged 1 commit into from
Nov 24, 2024

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Nov 24, 2024

Somehow the PathRef(T.workspace).path is causing issues, but it's totally redundant since we can just use T.workspace. Walking the out/ folder filesystem and hashing stuff seems to be causing problems with the file locks we use to ensure mutual exclusion

Seems to make example.kotlinlib.linting[1-detekt].local.test pass reliably where previously it was very flaky

@lihaoyi lihaoyi marked this pull request as ready for review November 24, 2024 22:55
@lihaoyi lihaoyi merged commit ecbdc4c into com-lihaoyi:main Nov 24, 2024
26 of 27 checks passed
lihaoyi added a commit that referenced this pull request Nov 25, 2024
Some follow ups after investigating
#4019

* Make the server's `ServerSocket` fixed per-server-process rather than
per-run, removing the race condition of the client reading a stale
`serverPort` that differs from what the server is currently listening on

* Make sure we delete all per-run files when starting a new run, so we
can be sure we don't get confused by reading stale metadata

* Clean up the error handling of `ServerLauncher#run` to avoid
swallowing exceptions silently

* Improve the comprehensiveness of `server.log` to make it easier to see
problems with multiple server processes overlapping
@lefou lefou added this to the 0.12.3 milestone Nov 25, 2024
@@ -21,7 +21,7 @@ trait DetektModule extends KotlinModule {

private def detekt0() = T.task {

val args = detektOptions() ++ Seq("-i", PathRef(T.workspace).path.toString()) ++
Copy link
Member

Choose a reason for hiding this comment

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

PathRef(T.workspace) is calculating an expensive (but unused) hash doomed to change as soon as we finish the task and write the cache to disc (into T.workspace/"out").

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.

2 participants