Rider won't run my unit test after a while (and I have to clear my cache)

I'm not sure what trigger it but it have been a problem for a while now. 

When I start the program I can run my unit test just fine but after a while the "run" button get a red cross and if I click on it I find the following log: 

Unfortunately, it's impossible to discover unit tests in some of your projects. :(
Below you can find the error details for each project.

Project: PROJECT_NAME (PATH_TO_MY_DLL)
Exception occurred during exploration.
JetBrains.ReSharper.UnitTestFramework.Common.Exceptions.ElementDoesNotExistException: Could not load element by id
at JetBrains.ReSharper.UnitTestFramework.Persistence.LevelDb.Query.QueryResult.GetEnumerator()+MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
at JetBrains.ReSharper.UnitTestFramework.Exploration.UnitTestDiscoveryTransaction.PrepareForCommit(IUnitTestTransaction tx)
at JetBrains.ReSharper.UnitTestFramework.Persistence.LevelDb.UnitTestTransaction.CommitCore()
at JetBrains.ReSharper.UnitTestFramework.Persistence.LevelDb.UnitTestTransaction.Commit()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at JetBrains.ReSharper.UnitTestFramework.Exploration.UnitTestDiscoveryTransaction.CommitAsync(CancellationToken ct)
at JetBrains.ReSharper.UnitTestFramework.Exploration.Artifacts.UnitTestArtifactExplorationRunner.ApplyExplorationResults(IExplorationResult[] results, IUnitTestDiscoveryTransaction tx, Boolean supportedByProvider, CancellationToken token)
at JetBrains.ReSharper.UnitTestFramework.Exploration.Artifacts.UnitTestArtifactExplorationRunner.ProcessProject(IExplorationTarget target, CancellationToken token)

Sometimes I can work for an hour without it happening and sometimes it happen after five minuts. The only way to get away from it seems to be File -> Invalidates cache but it's a bit annoying to have to do it. 

Someone else that have seen the same issue and maybe found a way to fix it or a different workaround that don't require a restart? Can't find any other discussion about it so not sure if it's just a local thing but it happen in multiple different solution so it doesn't seems to be related to a single project/solution.

0
1 comment

Hello Mille Bostrom,

Thank you for your request. We have a similar report currently open on our tracker, but to proceed with the investigation we need the logs. Would you be so kind to collect the logs if you can reproduce this on demand?

  1. Enable UnitTestingBackend scenario in Help | Diagnostic Tools | Choose Trace Scenarios
  2. Reproduce the problem
  3. Click Help | Collect Logs
  4. Disable the UnitTestingBackend trace scenario.

Please attach the produced archive to the YouTrack issue linked above.

Thank you in advance.

0

Please sign in to leave a comment.