-
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
ClassNotFoundException: no tests found on Orchestrator sharded runs #264
Comments
Same problem. The following command leads to this error "java.lang.ClassNotFoundException: Invalid name: no tests found" : When shardIndex=1, the class is well found and the tests are well executed. Versions |
I'm pretty sure I know what's going on. Looking at line 338 in TestRequestBuilder, when tests are divided into shards, it's sharded by Description#hashCode. But using hashcodes doesn't guarantee that the tests will be distributed evenly. It's not that hard to make a small example class with two tests that happen to have hashcodes that are either both odd or both even. Running two shards in that scenario causes both tests to be in one shard and the other shard showing the given error. |
@frogermcs , have you solved the issue? |
Update test_all.sh and exclude unit tests in release build
When I'm running sharded instrumentation tests with Orchestrator from the command line I encounter nondeterministic behavior which strongly depends on testing package name (or class name maybe?).
One version works fine, tests from the package are taken one after another. In another version I encounter errors:
It always happens for shardIndex=0 (shardsNum=2 or 3).
It’s not the cache probably. We can reproduce this issue on different machines.
Command
When I change package name by single letter:
From:
com.azimo.sendmoney.debug1.test/com.azimo.sendmoney.instrumentation.config.AzimoTestRunner
To (“A” at the end):
com.azimo.sendmoney.debug1.test/com.azimo.sendmoney.instrumentation.config.AzimoTestRunnerA
Problems don't happen.
Also if I run package in two shards, index=0 and index=1, despite java.lang.ClassNotFoundException error, all tests are run correctly (but they are all run on the emulator running shardIndex=1).
Versions
Test runner: 1.1.1
Espresso: 3.1.1
Orchestrator: 1.1.1 apk
Test services: 1.1.1 apk
Proguard - tried with minify enabled and disabled. Same results.
Our test runner does nothing unusual.
Interesting fact. When I log values from onCreate method bundle, failing run gets:
shardIndex 0
clearPackageData true
shellExecKey cb88bd77f522eeeb
package com.azimo.sendmoney.instrumentation.azimoTestCases.functional.AccountVerification
listTestsForOrchestrator true
numShards 2
orchestratorService OrchestratorService
The text was updated successfully, but these errors were encountered: