nowinandroid: [Bug]: DemoDebug Local test failed
Is there an existing issue for this?
- I have searched the existing issues
Is there a StackOverflow question about this issue?
- I have searched StackOverflow
What happened?
Run local tests on DemoDebug variant: ./gradlew testDemoDebug has failed test on the barely fork the repository.
I entered the command in the Execute Gradle Task on android studio.
But the test does not success, see below.
Any thing I missed? or is this already known issue?
Relevant logcat output
Output is so long, I'd add partially.
java.lang.IllegalArgumentException: resource native/windows/x86_64/robolectric-nativeruntime.dll not found.
java.io.IOException: Unable to rename C:\Users\Jaehwa\AppData\Local\Temp\junit4146744981157378858\user_preferences_test.pb.tmp.This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file.
14 tests completed, 4 failed
14 tests completed, 4 failed
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:92
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:74
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:53
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:92
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:74
Caused by: java.io.IOException at NiaPreferencesDataSourceTest.kt:53
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 16 (12 by maintainers)
https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12.1 was just released which should reduce the amount of log noise in Windows (though it won’t fix the underlying cause of this issue).
RE comparing screenshots across platforms (i.e. Linux / Mac / Linux): There are no guarantees that rendering will be consistent across different platforms. The underlying native libraries (e.g. skia, minikin, etc…) have platform-specific implementation details.
I was unable to reproduce this issue in roborazzi repository. Therefore, I attempted to use the nowinandroid repository and tried fixing it with ActivityScenario.close, but it seems to be ineffective. I also reviewed the Robolectric repository and noticed that @hoisie addressed a similar issue last week. https://github.com/robolectric/robolectric/commit/3b90118de04963282bc2389544ccfdc194dd1945#diff-31315cbee32dff759fd6d17e6d8939e67a292dc9e6c05591e4b95462a5ef1c43R44
@hoisie It might seem a bit abrupt, but are you aware of this?
From your Issues and relative links, I finally landed this page. Might be the datastore problem will be solved when the next DataStore version release. Thank you.
The issue with Roborazzi and DataStore are two different issue. For the DataStore issue, you can read more on this issue (especially the last comment with links):
Yes, I agree with that.
I checked that word from yours link.
I think it would be correct to express that Roborazzi does not support Windows OS, but rather Robolectric NATIVE GraphicsMode does not support Windows OS!
Yes, I’m use a Windows OS. Thank you, I didn’t know Roborazzi doesn’t support Windows OS. You say, encountered same error with DataStore, it gives me relief.
Are You a Windows OS User? Now in Android screenshot test library uses Roborazzi. This library uses Robolectric NATIVE GraphicsMode internally, but this does not support Windows OS and seems to cause the following error
So, the local screenshot tests would fail on Windows OS. ref: https://github.com/robolectric/robolectric/issues/8312
I am not sure of the exact cause of the problem with the DataStore, but I have encountered the same error, too.