-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Operation Kill Partest (part 1) #2125
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
Conversation
Awesome! I think this is missing one great feature from partest: A good summary report. When I scroll to the end of the logs I should be able to see at a glance:
A related feature is log files, which partest also outputs (but delete for non-failed tests), when the compiler output is really huge, it's very helpful to be able to navigate a log file instead of scrolling for hours. Also related: partest keeps output directories for failed run tests, this makes it easy to inspect them with javap or a decompiler to figure out what's going on. |
Also, I know this was already the case but it's really bugging me now: can we fix Compiling (1/546): Platform.scala
Compiling (2/546): ScalaBeanInfo.scala
Compiling (3/546): BeanInfoSkip.scala
... |
Basically all tests that instantiate a compiler should use a custom reporter that writes things to a logfile, that logfile should be kept only if specified by the user or if the test failed. |
Sure
Ah huh
Mhm All good ideas, I'll get them in tomorrow. |
), | ||
defaultOptions.and("-Xprompt") | ||
) | ||
}.times(2).pos() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try making a -Ytimes
option instead, as we discussed recently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - let's discuss this afternoon
0d3adda
to
7df4465
Compare
1978085
to
da8e352
Compare
… a real one Previously, we sometimes ended up forcing a companion class symbol from a previous run or from the classpath which lead to weird issues like in `false-companion`. Even if we end up not forcing such a symbol, its presence can still lead to issue: before this commit incremental compilation of `dotty-compiler-bootstrapped` was broken because we recorded a false dependency on the non-bootstrapped `dotty-compiler` jar. The added test is currently marked pending because it does not work with JUnit (which doesn't handle separate compilation), only partest. I didn't managed to get it to work right, and this won't be necessary once our testing framework is overhauled by scala#2125 anyway, so I'll just have to remember to enable this test afterwards.
b669dcb
to
b66f5d3
Compare
@felixmulder, is this PR ready for review? |
4809abc
to
b581ca1
Compare
@DarkDimius - yes mostly, I have two things left to add before I want this merged:
maybe the first one will affect the implementation somewhat, but the second one most likely won't. If you want to review it now that would be great, but you can also wait until I've fixed the first point. Up to you 🙂 |
c2b606b
to
4eb8cba
Compare
@DarkDimius - done with point 1 |
012a215
to
a28c497
Compare
if (seen.contains(elem.getMethodName)) false | ||
else { seen += elem.getMethodName; true } | ||
} | ||
.take(6).find { elem => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort of magic, we shouldn't go through more than a few levels of indirection... but maybe I should take out the magic number
Currently there is a check of creation dates. The compiler always picks the file that's newer. It has been done like this since the days of javac and I think it's a good strategy to keep. |
@DarkDimius Compiling is not the problem, the problem is that we use the same JVM to classload the compiler output for run tests, so if you classload |
@odersky, yes, that what I've meant by an old copy. Didn't know javac did the same. |
@smarter, JVM doesn't have global notion of classloading. It has class loading - per class loader. By setting up classloaders correctly you should be able to get behavior that custom implementation of the List will be preferred. |
@DarkDimius Yes you can do really crazy things if you try hard enough, but I don't think it's worth it since we'll go to multiple JVMs in the future. Also consider that currently the standard collection is on the bootclasspath, so I'm not even sure if you can override that. |
@smarter, I wouldn't consider 16 lines of trivial implementation code in java as "crazy things if you try hard enough". This is a lot simpler than things we do everyday here. I don't think this is going to be fixed by going multiple JVM approach if you'll reuse the VMs. |
2b495fb
to
73ad257
Compare
I don't think we'll need a custom ClassLoader implementation if we use multiple JVMs even if they're persistent. We can just launch the JVM with nothing from scala in the classpath, and everytime we want to run a test we ask the JVM to create a new URLClassLoader with the complete classpath we want to use and classload |
73ad257
to
02ebe0f
Compare
Can we agree to put this classloading business into part 2 of killing partest? 🙂 |
Given that it became such a contentious topic - yes. |
Let's remove partest after having this run for about a week or so alongside the new suite. |
I agree, but doesn't this pr remove partest from |
- ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;test ;dotty-bin-tests/test | ||
- ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;publishLocal ;dotty-bootstrapped/test | ||
- ;set testOptions in LocalProject("dotty-compiler") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only-no-bootstrap --show-diff --verbose | ||
- ;set testOptions in LocalProject("dotty-compiler-bootstrapped") += Tests.Argument(TestFrameworks.JUnit, "--exclude-categories=dotty.tools.dotc.ParallelTesting") ;partest-only --show-diff --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DarkDimius - here you can see that partest is still included, with the new unit tests filtered out.
Once we want to remove partest from the CI these, lines dissappear and the only two left will be:
- ;test ;dotty-bin-tests/test
- ;publishLocal ;dotty-bootstrapped/test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixmulder, thank you for clarification.
Alright - before we merge this. Can we decide upon a strategy for the memory settings? I have not been able to see much of a difference when altering them from the current settings. Especially now that partest is kept. |
For metaspace, the current change I believe is unnecessary. I would expect my proposed approach to be able to fit in <1gb of metaspace and <256mb of code-cache with a lot of spare room and be a lot more JIT friendly. |
It is necessary to do this in a new commit because of having to make sure that the signed drone file is current
… a real one Previously, we sometimes ended up forcing a companion class symbol from a previous run or from the classpath which lead to weird issues like in `false-companion`. Even if we end up not forcing such a symbol, its presence can still lead to issue: before this commit incremental compilation of `dotty-compiler-bootstrapped` was broken because we recorded a false dependency on the non-bootstrapped `dotty-compiler` jar. The added test is currently marked pending because it does not work with JUnit (which doesn't handle separate compilation), only partest. I didn't managed to get it to work right, and this won't be necessary once our testing framework is overhauled by scala#2125 anyway, so I'll just have to remember to enable this test afterwards.
Partest is dead, long live [name for new testing "framework"]!