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

Not found CIOEngineContainer flank.jar #1979

Closed
jan-goral opened this issue May 31, 2021 · 0 comments · Fixed by #1982
Closed

Not found CIOEngineContainer flank.jar #1979

jan-goral opened this issue May 31, 2021 · 0 comments · Fixed by #1982
Assignees

Comments

@jan-goral
Copy link
Contributor

jan-goral commented May 31, 2021

Describe the bug

The build configuration is not packing io.ktor.client.engine.cio.CIOEngineContainer into flank.jar

To Reproduce

From repository root, build flank and run the command:

.  .env
flankScripts assemble flank
flank corellium test android run -c="test_configs/any_valid_corellium_config.yml"

using any valid Flank-Corellium configuration file, for example:

auth: "test_configs/corellium_auth.yml"
apks:
  - path: "test_artifacts/master/apk/app-debug.apk"
    tests:
      - path: "test_artifacts/master/apk/app-multiple-flaky-debug-androidTest.apk"

this will print the log with the following error:

$ flank corellium test android run -c=test_configs/flank-corellium.yml 
* Authorizing
* Parsing test cases
* Calculating shards
* Preparing output directory
Created ./flank/results/corellium/android/2021-05-31_08-15-24-826
* Dumping shards
Created ./flank/results/corellium/android/2021-05-31_08-15-24-826/android-shards.json
* Invoking devices
Getting instances already created by flank.
Obtained 1 already created devices
Wait until all instances are ready...
ready: 01e8d313-c907-4a3f-ad7d-c726cac6655e
All instances invoked and ready to use.
* Installing apks
Connecting agent for 01e8d313-c907-4a3f-ad7d-c726cac6655e
* Parsing apk info
* Executing tests
Getting console 01e8d313-c907-4a3f-ad7d-c726cac6655e
java.util.ServiceConfigurationError: io.ktor.client.HttpClientEngineContainer: Provider io.ktor.client.engine.cio.CIOEngineContainer not found
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1211)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1383)
        at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1293)
        at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1326)
        at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1317)
        at io.ktor.client.HttpClientJvmKt.<clinit>(HttpClientJvm.kt:39)
        at flank.corellium.client.agent.ConnectKt.connectAgent(Connect.kt:26)
        at flank.corellium.client.core.ApiKt.connectAgent(Api.kt:146)
        at flank.corellium.adapter.InstallAndroidAppsKt$installAndroidApps$1$1.invokeSuspend(InstallAndroidApps.kt:33)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Total run duration: 0m 18s

Expected behavior

The Flank-Corellium execution should pass without errors related to missing dependencies.

Additional context

If the command is giving a different error make sure the following dependencies are added to the test_runner/build.gradle:

    implementation(Dependencies.KTOR_CLIENT_SERIALIZATION)
    implementation(Dependencies.KTOR_CLIENT_WEBSOCKETS)
    implementation(Dependencies.KTOR_CLIENT_LOGGING)
    implementation(Dependencies.KTOR_CLIENT_CORE)
    implementation(Dependencies.KTOR_CLIENT_CIO)
@jan-goral jan-goral self-assigned this May 31, 2021
@mergify mergify bot closed this as completed in #1982 May 31, 2021
mergify bot pushed a commit that referenced this issue May 31, 2021
Fixes #1979 

## Test Plan
> How do we know the code works?

Add the configuration file `test_configs/corellium_auth.yml` and call:

```shell
.  .env
flankScripts assemble flank
flank corellium test android run -c="test_configs/flank-corellium.yml"
```

The execution should pass without exceptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant