question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unit Test failed when the emulator not connected to network | CI Connected Unit Tests

See original GitHub issue

MSAL 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:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
heidijinxujiacommented, May 30, 2017

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.

0reactions
weijjiacommented, May 31, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found