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 methods within a single test class paralled #2064

Closed
ddwolf opened this issue Nov 9, 2016 · 12 comments
Closed

test methods within a single test class paralled #2064

ddwolf opened this issue Nov 9, 2016 · 12 comments

Comments

@ddwolf
Copy link

ddwolf commented Nov 9, 2016

is there a way to make bazel test running the methods in a single test class multi-threaded?

@benley
Copy link
Contributor

benley commented Nov 11, 2016

What language are you working with? What test framework?

@ddwolf
Copy link
Author

ddwolf commented Nov 11, 2016

@benley I just run test under bazel, using bazel's test command.
bazel test ...

oh, I am working with java, and spring framework.

@aehlig
Copy link
Contributor

aehlig commented Nov 11, 2016

If you're using Bazel's java_test, you might want to look at the shard_count. If this is not what you've been looking for, can you please describe in more detail what you need.

@GinFungYJF
Copy link
Contributor

@aehlig I set shard_count in my java_test, but it seems to take more time.

@GinFungYJF
Copy link
Contributor

@aehlig The log of one of the sharding:

-----------------------------------------------------------------------------
JUnit4 Test Runner
CORE is running
.
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.5.RELEASE)


Time: 7.774

OK (1 test)


BazelTestRunner exiting with a return value of 0
JVM shutdown hooks (if any) will run now.
The JVM will exit once they complete.

-- JVM shutdown starting at 2016-11-14 03:53:59 --

Does it show that every sharding would start an JVM? Is it the reason why setting shard_count takes more time?

@ddwolf
Copy link
Author

ddwolf commented Nov 23, 2016

@aehlig GinFungYJF have provided the messages I have, after I use shard option, the test process takes more time, that's not what I want.

@ulfjack
Copy link
Contributor

ulfjack commented Dec 1, 2016

There's more discussion of sharding in #2113. I'm not sure there are any action items here for us. There may be a junit extension to do multi-threading within a single Jvm, if the Jvm startup overhead is too large for sharding...

@damienmg
Copy link
Contributor

damienmg commented Dec 5, 2016

There is an on-going work to make junit test faster to avoid JVM startup time. I don't think we can do more than that.

Closing this issue since there is no specific action item for it.

@damienmg damienmg closed this as completed Dec 5, 2016
@ddwolf
Copy link
Author

ddwolf commented Dec 5, 2016

@damienmg: have you considered using junit's ParallelComputer to make the test running faster?

@damienmg
Copy link
Contributor

damienmg commented Dec 5, 2016

No I don't think so, our sharding tooling dates back from JUnit3 where there was no such thing as ParallelComputer. It also has some hermeticity issues.

@ulfjack
Copy link
Contributor

ulfjack commented Dec 5, 2016

We could potentially add support for parallel computer on an opt-in basis as well. Feel free to file a feature request for that. So far we have not looked at that, and it also hasn't been a good match for how our internal systems work.

@ddwolf
Copy link
Author

ddwolf commented Dec 6, 2016

@ulfjack I am working on that:) some problems...the spring initializing failed when I import ParallelComputer into bazel.

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

No branches or pull requests

6 participants