Unit Test failed when the emulator not connected to network | CI Connected Unit Tests
See original GitHub issueMSAL Android CI got failed on tests with mocked HTTP connections when running the emulator without network. This is not expected as unit tests, there probably is a bug on the mocked URL connections code.
05-26 14:13:16.633 1634-1659/? E/BaseRequest: MSAL 0.1.1 Android 23 [2017-05-26 21:13:16 - 351b338b-3f8a-437e-8e52-fe78148f27e3] Error occurred during authentication. com.microsoft.identity.client.MsalClientException: Device network connection is not available.
at com.microsoft.identity.client.BaseRequest.throwIfNetworkNotAvailable(BaseRequest.java:219)
at com.microsoft.identity.client.BaseRequest.performTokenRequest(BaseRequest.java:166)
at com.microsoft.identity.client.SilentRequest.performTokenRequest(SilentRequest.java:103)
at com.microsoft.identity.client.BaseRequest$1.run(BaseRequest.java:107)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
05-26 14:13:16.633 1634-1634/? W/System.err: com.microsoft.identity.client.MsalClientException: Device network connection is not available.
05-26 14:13:16.633 1634-1634/? W/System.err: at com.microsoft.identity.client.BaseRequest.throwIfNetworkNotAvailable(BaseRequest.java:219)
05-26 14:13:16.633 1634-1634/? W/System.err: at com.microsoft.identity.client.BaseRequest.performTokenRequest(BaseRequest.java:166)
05-26 14:13:16.633 1634-1634/? W/System.err: at com.microsoft.identity.client.SilentRequest.performTokenRequest(SilentRequest.java:103)
05-26 14:13:16.633 1634-1634/? W/System.err: at com.microsoft.identity.client.BaseRequest$1.run(BaseRequest.java:107)
05-26 14:13:16.633 1634-1634/? W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
05-26 14:13:16.633 1634-1634/? W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
05-26 14:13:16.633 1634-1634/? W/System.err: at java.lang.Thread.run(Thread.java:818)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Unit tests not working on Android Studio Arctic Fox
It appears that if you update to the latest Gradle plugin, right clicking on a test class will prompt a new Gradle "Create...
Read more >Test from the command line | Android Developers
Run tests with Gradle ; Instrumented unit test, Run the connectedAndroidTest task: ./gradlew connectedAndroidTest, HTML test result files:
Read more >Testing security rules | Firestore - Google Cloud
If your tests are occasionally passing and failing, even without any changes to the tests themselves, you might need to verify that they're...
Read more >Visual Studio 2022 Release Notes | Microsoft Learn
Live Unit Testing now supports Razor files. Run Tests until failure helps you find flaky tests and will run your unit test until...
Read more >Developing Android unit and instrumentation tests - Tutorial
Instrumented unit tests are unit tests that run on Android devices and emulators instead of running on the Java virtual machine. These tests...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @iambmelt, update. I’ve fixed the emulator network issue in Hyper-V. The unit tests get passed now. Thanks for the help of @addev-ashish on Hyper-V knowledge. 😃 Our next task, as discussed with @addev-ashish , is to remove the dependencies of the unit tests on the emulator network connection.
@heidijinxujia If you get the unit test passed in CI, can you close the issue and we’ll open another one to track unit tests update. Thanks.