Skip to content

Conversation

@Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Nov 7, 2023

It seems that swoval's PathWatchers.Event sometimes returned a path, for which the RelPath we checked in the event filter didn't have an available last segment (as it was probably empty) and reacted with a PathError. 🤡
Which was then hard to see, as it was hidden behind a timeout in BloopTests.Restart Bloop server while watching.
I can't replicate this locally.
Example failure: https://github.com/VirtusLab/scala-cli/actions/runs/6683093329/job/18159052355#step:5:503

os.PathError$LastOnEmptyPath: empty path has no last segment
	at os.PathError$LastOnEmptyPath$.apply(Path.scala:225)
	at os.BasePathImpl.last$$anonfun$1(Path.scala:207)
	at scala.Option.getOrElse(Option.scala:201)
	at os.BasePathImpl.last(Path.scala:207)
	at os.BasePathImpl.last$(Path.scala:187)
	at os.RelPath.last(Path.scala:256)
	at scala.build.Build$.isScalaFile$1(Build.scala:708)
	at scala.build.Build$.$anonfun$31(Build.scala:710)
	at scala.build.Build$.doWatch$1$$anonfun$1$$anonfun$1(Build.scala:722)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.build.Build$$anon$1.onNext(Build.scala:1180)
	at scala.build.Build$$anon$1.onNext(Build.scala:1179)
	at com.swoval.files.Observers.onNext(Observers.java:31)
	at com.swoval.files.SymlinkFollowingPathWatcher$1.onNext(SymlinkFollowingPathWatcher.java:58)
	at com.swoval.files.SymlinkFollowingPathWatcher$1.onNext(SymlinkFollowingPathWatcher.java:36)
	at com.swoval.files.Observers.onNext(Observers.java:31)
	(...)

This should hopefully address this (or at the very least give us a meaningful exception if it still fails).

Beyond that, RunTestsDefault.watch artifacts & BloopTests.Restart Bloop server while watching will temporarily be skipped for Mac OS only (until we find a way to make those pass reliably on Mac CI, as they've been making intermittent errors a headache)

@Gedochao Gedochao changed the title Fix wonky --watch tests Fix --watch failing on invalid PathWatchers.Event Nov 7, 2023
@Gedochao Gedochao force-pushed the maintenance/wonkty-watch-tests branch from 476c389 to acf6ace Compare November 7, 2023 10:43
@Gedochao Gedochao force-pushed the maintenance/wonkty-watch-tests branch from acf6ace to 39a638b Compare November 7, 2023 13:12
@Gedochao Gedochao changed the title Fix --watch failing on invalid PathWatchers.Event Fix --watch failing on invalid PathWatchers.Event & skip wonky tests on Mac CI Nov 7, 2023
@Gedochao Gedochao marked this pull request as ready for review November 7, 2023 14:52
@Gedochao Gedochao merged commit c4a76f1 into VirtusLab:main Nov 8, 2023
@Gedochao Gedochao deleted the maintenance/wonkty-watch-tests branch November 8, 2023 07:38
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