-
Notifications
You must be signed in to change notification settings - Fork 319
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
Frequent 'No tests found' when sharding tests #973
Comments
#264 looks similar |
AJUR's algorithm is a fork of bazel's HashBackedStrategy. https://github.com/bazelbuild/bazel/blob/master/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/HashBackedShardingFilter.java However, I notice that the bazel default is a RoundRobinStrategy I cannot remember why the hash-backed algorithm was chosen for AJUR - perhaps because it was simpler...? Changing the sharding algorithm could be disruptive, but perhaps we could make it configurable like bazel... |
I think the hash based was chosen because of its stability, or at least that's a good argument for it. Adding/removing/renaming a test doesn't affect all the shards only that one test (maybe) moves to another shard, the rest is exactly as is. While with the round robin, renaming a test would totally reassign shards. This type of stability is really good for reproducibility and debugging flakyness. +1 for custom sharding with some good built-in examples. |
package androidx.test.ui.app ;import android.app.Service;import android.content.Intent ;import android.content.res.Configuration;import android.graphics.Color; |
$variable_name = value; Loops
If switch(conditional-expression) { default:
for(Initialization; Condition; Increment/decrement){ foreach ($array as $key => $element-value) { while(condition) { do { How to define a Function |
Description
When sharding tests I get frequent (and seemingly random) 'No tests found' errors which fail the build.
See this PR: google/accompanist#463 for an example.
Steps to Reproduce
I'm not 100% sure what the repro is. Having a small number of tests in the module seems to be the trigger.
I think this is because the library is relying on hashCode being uniformly random over a small data-set, which isn't the case. If the module only has ~5 tests, and I'm sharding over 3 runs, the chance of at least 1 shard having 0 tests is quite high.
Expected Results
Shards with no tests from a module don't fail the build.
Actual Results
AndroidX Test and Android OS Versions
1.3.0
Link to a public git repo demonstrating the problem:
google/accompanist#463
The text was updated successfully, but these errors were encountered: