Skip to content

Conversation

@SethTisue
Copy link
Member

this is the next step after #4884

@scala-jenkins scala-jenkins added this to the 2.11.8 milestone Jan 29, 2016
@SethTisue
Copy link
Member Author

(not done yet: making it respect scalac.args.optimise)

@SethTisue
Copy link
Member Author

hello permgen our old friend you've come to talk to us again

sbt.ForkMain$ForkError: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error running /home/jenkins/workspace/scala-2.11.x-validate-test/test/files/scalacheck/Ctrie.scala
Caused by: sbt.ForkMain$ForkError: java.lang.OutOfMemoryError: PermGen space

@SethTisue
Copy link
Member Author

if I run test/partest test/files/scalacheck/Ctrie.scala by itself, locally, it passes even with -XX:MaxPermSize=48M, so it seems this isn't an unusually PermGen hungry test. which has me worried scala-partest-interface might be doing something PermGen-unfriendly, perhaps holding on to classloader references between tests.

@SethTisue
Copy link
Member Author

increasing PermGen from 128M to 192M didn't help — and failed on the exact same test.

note also # 111/117 passed, 6 failed in jvm ("compilation failed" errors)

@retronym
Copy link
Member

retronym commented Feb 2, 2016

sbt/sbt#1223 might offer some clues. SBT forces GC and finalization periodically if the number of objects pending finalization exceeds a threshold. It appears that this is only done after a task has executed, so it probably won't help if a single task like tests/it:test internally leaks.

@SethTisue
Copy link
Member Author

The permgen failure also happens when running locally on Mac OS X. It sat a long time before failing; sample stack trace not long before failing: https://gist.github.com/SethTisue/8db45ef617a0542057b2

@szeiger
Copy link
Contributor

szeiger commented Feb 2, 2016

Strange, I can run partest locally from sbt without problems.

@SethTisue
Copy link
Member Author

sbt/sbt#1223 might offer some clues

I don't think so, because partest runs in a forked JVM.

Strange, I can run partest locally from sbt without problems

@szeiger on Java 6?

@szeiger
Copy link
Contributor

szeiger commented Feb 2, 2016

Hah, good point, I probably only ran it on Java 8.

@SethTisue
Copy link
Member Author

as I study a log of the old test/validate script a little closer, I see that ant was invoking partest multiple times, once per category of test. whereas in sbt we're doing one single giant partest invocation. so it's actually not surprising this might cause a PermGen regression, and I don't think there's any need to investigate the details.

I'll just change it to match the old setup. the easiest way, as @retronym suggests, is simply not to invoke partest through sbt at all. at some point, we might like to change test/it:partest to do the multiple invocations, but for now, we can just bypass sbt-partest-interface altogether. this still accomplishes our main goal which is to get ant out of the picture.

@szeiger
Copy link
Contributor

szeiger commented Feb 2, 2016

@SethTisue you can run individual categories from sbt, e.g. test/it:testOnly -- --run. I hope the syntax is right. I'm on Windows right now and I just noticed that partest in sbt tries to run pull-binary-libs for some reason. I need to look into that.

rather use sbt and direct invocation of partest

this is the next Ant-elimination step after scala#4884
@SethTisue SethTisue force-pushed the validate-test-use-sbt branch from 6a12c52 to 93b84a3 Compare February 3, 2016 00:44
@SethTisue
Copy link
Member Author

you can run individual categories from sbt

good to know. ultimately, we should switch to that.

@SethTisue
Copy link
Member Author

it didn't fail the job, but:

Archiving artifacts
WARN: No artifacts found that match the file pattern "build/junit/TEST-*,build/osgi/TEST-*,hs_err_*.log". Configuration error?
WARN: ‘build/junit/TEST-*’ doesn’t match anything: ‘build’ exists but not ‘build/junit/TEST-*’

@SethTisue
Copy link
Member Author

sigh, test/partest actually runs ant -q test.suite.init, so we're not cutting ant out of the picture by calling test/partest unless that's changed, and it also then reads partest.properties to construct a classpath, and that classpath uses the ant build directory, not the sbt build directory. so this needs more work.

@retronym
Copy link
Member

retronym commented Feb 3, 2016

and it also then reads partest.properties to construct a classpath

The SBT build now generates this file, albeit under ./build-sbt.

See 2a57f82

We'd still need to modify the partest script to avoid calling ant, perhaps when provided with --no-ant.

@szeiger
Copy link
Contributor

szeiger commented Feb 3, 2016

That explains why it fails on Windows. I don't think partest or sbt-partest-interface should call any script at all. All that suite.init does is to build the classpath for partest in build/pack/partest.properties, which triggers a full ant build and pulling the libraries with the shell script, because all that stuff goes on the classpath. I wonder why I haven't noticed this before. sbt can build a correct partest.properties (but it goes into build-sbt/quick) which works for running partest from the command line. We should pass that to partest from sbt instead of calling ant.

@szeiger
Copy link
Contributor

szeiger commented Feb 3, 2016

It looks like the problem with partest in sbt is really just

scala/build.sbt

Line 536 in 9fb85af

testOptions in IntegrationTest += Tests.Setup( () => root.base.getAbsolutePath + "/pull-binary-libs.sh" ! ),
. Remove that line and it runs successfully.

I tested this on a Windows system that doesn't even have ant installed. This includes running partest from the shell (MSYS bash) after sbt dist/mkQuick and cp build-sbt/quick/partest.properties build/pack/. No ant and no JARs in lib required.

@SethTisue SethTisue force-pushed the validate-test-use-sbt branch 3 times, most recently from 1b068a5 to fc73bbc Compare February 10, 2016 01:04
@SethTisue SethTisue force-pushed the validate-test-use-sbt branch from fc73bbc to 64c0334 Compare February 10, 2016 19:26
@SethTisue
Copy link
Member Author

MiMa failure:

[info] Checking backward binary compatibility
[error] (run-main-1) java.lang.ArrayIndexOutOfBoundsException: 1477
[error] (run-main-0) java.lang.ArrayIndexOutOfBoundsException: 1477
java.lang.ArrayIndexOutOfBoundsException: 1477
    at com.typesafe.tools.mima.core.BufferReader.nextByte(BufferReader.scala:33)
    at com.typesafe.tools.mima.core.BufferReader.nextInt(BufferReader.scala:53)
    at com.typesafe.tools.mima.core.ClassfileParser$$anonfun$skipAttributes$1.apply$mcVI$sp(ClassfileParser.scala:269)

doesn't happen when I run locally. perhaps the 2.11.0 jar it's trying to use isn't a real jar, perhaps because retrieving it failed because validation stuff is running with special resolver settings, that kind of thing. I'll look into it (but not right away).

runsbt "test/it:testOnly -- specialized"
runsbt "test/it:testOnly -- scalacheck"
runsbt "test/it:testOnly -- instrumented"
runsbt "test/it:testOnly -- presentation"
Copy link
Member

Choose a reason for hiding this comment

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

TODO (pending a new partest release to honour --srcpath)

runsbt "test/it:testOnly -- --srcpath scaladoc --run"
runsbt "test/it:testOnly -- --srcpath scaladoc --scalacheck"

// TODO: it would be nicer if each subproject had its own whitelist, but for now
// for compatibility with how Ant did things, there's just one at the root.
// once Ant is gone we'd be free to split it up.
filter = baseDirectory.value / ".." / ".." / s"bincompat-$direction.whitelist.conf",
Copy link
Member

Choose a reason for hiding this comment

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

I'd opt for (baseDirectory in ThisBuild).value / s"bincompat-$direction.whitelist.conf",

@SethTisue SethTisue changed the title when running tests during PR validation, use sbt not ant when running tests during PR validation, use sbt not ant [ci:last-only] Feb 11, 2016
@SethTisue SethTisue self-assigned this Feb 11, 2016
@SethTisue SethTisue force-pushed the validate-test-use-sbt branch from c813859 to 44c9ef1 Compare February 13, 2016 00:31
@SethTisue
Copy link
Member Author

MiMa failure: [...]

turned out to be transient, so I think the MiMa part of this is done (& I can move on to the other remaining parts)

yum! delicious dogfood!
@SethTisue SethTisue modified the milestones: 2.11.9, 2.11.8 Feb 23, 2016
@SethTisue SethTisue changed the title when running tests during PR validation, use sbt not ant [ci:last-only] when running tests during PR validation, use sbt not ant [ci: last-only] Feb 24, 2016
@szeiger
Copy link
Contributor

szeiger commented May 30, 2016

Closing in favor of #5190

@szeiger szeiger closed this May 30, 2016
@SethTisue SethTisue removed this from the 2.11.9 milestone Oct 18, 2016
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.

6 participants