Сann't Build the Project Under Mac OS (original) (raw)
Мамонтов Иван ivan.mamontov at gmail.com
Sun May 12 03:14:02 PDT 2013
- Previous message: hg: code-tools/jmh: 2 new changesets
- Next message: Сann't Build the Project Under Mac OS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello!
When I try to build the project(Mac OS 10.7.5, JDK 1.7.0_17), I get an error message:
org.openjdk.jmh.it.interorder.BenchmarkBenchOrderTest#test Exception in thread "main" java.lang.IllegalStateException: Setup/invocation called before run at org.openjdk.jmh.runner.BaseRunner.runClassicBenchmark(BaseRunner.java:109) at org.openjdk.jmh.runner.ForkedRunner.runForkedBenchmarks(ForkedRunner.java:62) at org.openjdk.jmh.runner.ForkedRunner.run(ForkedRunner.java:55) at org.openjdk.jmh.ForkedMain.main(ForkedMain.java:54) Caused by: java.lang.IllegalStateException: Setup/invocation called before run at org.openjdk.jmh.runner.LoopMicroBenchmarkHandler.runIteration(LoopMicroBenchmarkHandler.java:139) at org.openjdk.jmh.runner.BaseRunner.runMicroBenchmark(BaseRunner.java:130) at org.openjdk.jmh.runner.BaseRunner.runClassicBenchmark(BaseRunner.java:94) ... 3 more
The main reason for this exception is an implementation of the method System#nanoTime() for Mac OS. For example, following peace of code:
while (true) { System.out.println(System.nanoTime()); } will produce following output:
1368352921718198000 1368352921718200000 1368352921718203000 1368352921718205000 1368352921718207000 1368352921718210000 1368352921718212000 1368352921718214000 1368352921718217000
I think it makes sense to make test more platform independent, i.e. avoid System.nanoTime() method call.
-- Many thanks, Ivan.
- Previous message: hg: code-tools/jmh: 2 new changesets
- Next message: Сann't Build the Project Under Mac OS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]