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

Test Failure - ChunkCachePerformanceTest #225

Closed
mawaldne opened this issue Apr 8, 2012 · 11 comments
Closed

Test Failure - ChunkCachePerformanceTest #225

mawaldne opened this issue Apr 8, 2012 · 11 comments
Labels
Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Type: Bug Issues reporting and PRs fixing problems

Comments

@mawaldne
Copy link

mawaldne commented Apr 8, 2012

Hey guys,

After "gradle test" I get the following error:

Test testChunkCash(org.terasology.world.ChunkCachePerformanceTest) FAILED: java.lang.OutOfMemoryError: Java heap space
Test org.terasology.world.ChunkCachePerformanceTest FAILED
Execution for Test process 'Gradle Worker 1' FAILED
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not execute test class 'org.terasology.world.ChunkCachePerformanceTest'.

Note I am on a hippie mac. OSX 10.6.8

@mawaldne
Copy link
Author

mawaldne commented Apr 8, 2012

Was hoping I could do this in the gradlew script. But it doesn't seem to help:

DEFAULT_JVM_OPTS="-Xms2048m -Xmx2024m"
.....

@mawaldne
Copy link
Author

mawaldne commented Apr 8, 2012

I was able to run this test from within IntelliJ. I can set VM options like the above and it passes.

I think Gradle just isn't taking vm options at command line. I'll keep digging.

@Cervator
Copy link
Member

Cervator commented Apr 8, 2012

Interesting. Nice research, thanks :-)

Pinging @KaiKratz as I believe he did that test - maybe he'll have an idea; or @rapodaca as he did some of the initial Gradle & unit testing stuff

@mawaldne
Copy link
Author

mawaldne commented Apr 8, 2012

I'm an idiot - when you update the gradlew, you have to run the test using that script. So this seems to solve the heap issue:

./gradlew test -Dtest.single=ChunkCachePerformanceTest -info

But I'm getting another weird issue:

Test testChunkCash(org.terasology.world.ChunkCachePerformanceTest) FAILED: java.lang.RuntimeException: Resource not found: org/terasology/data/fonts/default.fnt

Still digging...

@Cervator
Copy link
Member

Cervator commented Apr 8, 2012

Progress is progress!

We had another user hit that default.fnt issue - described over here: http://board.movingblocks.net/viewtopic.php?p=1586#p1586

Not sure if that was solved

@mawaldne
Copy link
Author

mawaldne commented Apr 8, 2012

Yeah its a weird one - its also annoying to try and debug because I can't seem to get logging to work in gradle test.

Like any logger.info("blah") I put in the test doesn't work. shakes fist

@Cervator
Copy link
Member

Cervator commented Apr 8, 2012

You tell Gradle what log level you want when running it, that confused me for a bit too :-)

http://gradle.org/docs/current/userguide/logging.html

@mawaldne
Copy link
Author

mawaldne commented Apr 8, 2012

Its dying here - FontManager.java:

       _fonts.put("default", new AngelCodeFont("Font", ResourceLoader.getResource("org/terasology/data/fonts/default.fnt").openStream(), ResourceLoader.getResource("org/terasology/data/fonts/default_0.png").openStream()));

Something to do with paths ResourceLoader is using from test as opposed from src I think...But I dont have a resolution yet...

@Cervator
Copy link
Member

Cervator commented Apr 8, 2012

Oh interesting. We've had issues with resource loading in the past, especially when maintaining compatibility with running Terasology as an applet. Looks like the loader in this case is by Slick, wonder if there are any known issues on that plus Macs.

Incidentally you should totally register for the forums at http://board.movingblocks.net and hop on IRC http://wiki.movingblocks.net/Main/UsingIrc sometime, had a discussion there on timers and what not just now, your fix for that has been pulled - thanks again, and here's for hoping to see more interesting stuff from you :D

Edit: Oh wait, you already hopped on the forum. I'm too slow!

@mawaldne
Copy link
Author

So the final solution to this was contained here:
http://gradle.org/docs/current/dsl/org.gradle.api.tasks.testing.Test.html

I ended up adding this section in build.gradle under the sourcesets section:

test {
//makes the standard streams (err and out) visible at console when running tests
testLogging.showStandardStreams = true

//tweaking memory settings for the forked vm that runs tests
jvmArgs '-Xms512m', '-Xmx1024m', '-XX:MaxPermSize=128m'
}

Test is running fine now. gradle forks a process to run tests so you need the above to set the memory for that

@Cervator
Copy link
Member

The new task has been merged to develop! But coincidentally that one performance test got moved out at the same time :D

On the plus side we now have more test logging available and everything runs flawlessly, at least for a few of us :-)

Maybe we can add a second test task to execute the performance tests, of which we only have the one? Anyway, that's sort of a whenever / when needed thing so I'm closing this. Thanks @mawaldne!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

2 participants