Coder Social home page Coder Social logo

[Bug]: The unit test offlineFirstTopicsRepository_toggle_followed_topics_logic_delegates_to_nia_preferences() failed about nowinandroid HOT 7 OPEN

android avatar android commented on May 21, 2024 2
[Bug]: The unit test offlineFirstTopicsRepository_toggle_followed_topics_logic_delegates_to_nia_preferences() failed

from nowinandroid.

Comments (7)

SimonMarquis avatar SimonMarquis commented on May 21, 2024 1

It seems to be a known issue on Windows:

from nowinandroid.

SimonMarquis avatar SimonMarquis commented on May 21, 2024 1

androidx.datastore:datastore-*:1.1.0-beta02 landed:

Fixed the issue where file rename fails during updateData in non-Android JVM environments. (b/203087070)
https://developer.android.com/jetpack/androidx/releases/datastore#1.1.0-beta02

Unfortunately, the issue persists...

from nowinandroid.

Rocksnake avatar Rocksnake commented on May 21, 2024

I think the reason should be that two DataStore's writing at the same time, one of the renames seems to be failing, because the file no longer exists.

I think the place where the problem occurs should be in the TestDataStoreModule.kt file, We should instead create the DataStore once, then inject the instance where necessary or manage it as a singleton.
image

from nowinandroid.

alexvanyo avatar alexvanyo commented on May 21, 2024

Hi, is this still an issue with the latest version?

from nowinandroid.

SimonMarquis avatar SimonMarquis commented on May 21, 2024

FWIW, on a Windows machine, I'm unable to run the whole test suite. Many unit tests fail while SingleProcessDataStore tries to write the new data as shown above.

from nowinandroid.

JackEblan avatar JackEblan commented on May 21, 2024

Hello @SimonMarquis I am also experiencing this java.io.IOException: Unable to rename C:\Users\User\AppData\Local\Temp\junit481202955115791832\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. Is there a way to make this work on my Windows 10?

from nowinandroid.

SimonMarquis avatar SimonMarquis commented on May 21, 2024

No, but you can ⭐ & +1 this issue: https://issuetracker.google.com/issues/203087070

from nowinandroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.