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

PC invalidates previous work on new run #10867

Draft
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

The "up-to-date" check is not sufficient when fetching doc comments, since a unit may have been typechecked, with doc wrapper trees removed.

A test instability was due to whether the scheduler was checked by a callback or the runner thread.
One sample file had no parser callbacks at all.

Probably the change at demandNewCompilerRun can be refined, as it matters just for doc comments.

askParse is tweaked to submit one file at a time, since otherwise the parser callback on the first job will look for work and start the next parse. (In this test, the chain stopped there because the second file was trivial and invoked no callback.)

Fixes scala/scala-dev#840

The "up-to-date" check is not sufficient when fetching
doc comments, since a unit may have been typechecked,
with doc wrapper trees removed.

A test instability was due to whether the scheduler
was checked by a callback or the runner thread.
One sample file had no parser callbacks at all.
@scala-jenkins scala-jenkins added this to the 2.13.16 milestone Sep 20, 2024
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

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

Looks good / safe to me, I don't fully follow (what are the "parser callbacks"?)

@@ -301,6 +301,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
def isOutOfDate: Boolean = outOfDate

def demandNewCompilerRun() = {
if (!lastWasReload) allSources.foreach(getUnit(_).foreach(reset(_)))
Copy link
Member

Choose a reason for hiding this comment

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

would it be equivalent to add a boolean param to demandNewCompilerRun and set it true at the callsite in reload?

@som-snytt
Copy link
Contributor Author

There is signalParseProgress and then signalDone when a tree is typed (TIL).

@som-snytt
Copy link
Contributor Author

BTW I was curious (or annoyed) about the test; it's not my intention to muck with (or break) the PC. I assumed incorrectly that it would be a mechanism problem that required no special knowledge of PC semantics and operations.

@SethTisue SethTisue modified the milestones: 2.13.16, 2.13.17 Dec 12, 2024
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.

The most infamous flaky test
4 participants