Base solution for your next web application
Open Closed

Unit Test Error Randomly #1112


User avatar
0
andis created

I ran all unit test from aspnetzero project. Why always got some unit tests failed. Failed Test are randomly occur and if I run again those failed tests, they will pass.

Result Message: System.Data.Entity.Infrastructure.CommitFailedException : An error was reported while committing a database transaction but it could not be determined whether the transaction succeeded or failed on the database server. See the inner exception and <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkId=313468">http://go.microsoft.com/fwlink/?LinkId=313468</a> for more information. ---- System.Transactions.TransactionAbortedException : The transaction has aborted. -------- System.TimeoutException : Transaction Timeout


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/issues/195">https://github.com/aspnetzero/aspnet-zero/issues/195</a>

  • User Avatar
    0
    supero created

    I Have the same problem, i have a looping of a variables inserts, morde than 2000 for example, its take time, but, how can i configure the time limit?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It's mentioned in the issue actuallay

    Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(1);
    

    But in order to insert that much records at once it's better not to use Entity Framework directly if you need performance. You can use custom sql in a custom repository.