Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-554

Creating a realm instance via xUnit crashes

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • Q4-22FY
    • Affects Version/s: None
    • Component/s: None

      What happened?

      • Attempt to create a new realm context in a test
      • Receive incorrect thread error

      Repro steps

      git clone https://github.com/peppy/osu-realm-structural-integrity
      cd osu-realm-structural-integrity
      git checkout help
      dotnet test
      

      Relevant repo: https://github.com/peppy/osu-realm-structural-integrity/tree/help

      Changing the filename to a constant filename (ie. not using Guid.New) will fail the first run but pass the second. Note that this failure is at a native level and halts the test runner, meaning all further tests also fail and no managed Exception is thrown. Pretty scary.

      Version

      10.5.0

      What SDK flavour are you using?

      Local Database only

      What type of application is this?

      Console/Server

      Client OS and version

      macOS 12.0

      Code snippets

      No response

      Stacktrace of the exception/crash you're getting

      No response

      Relevant log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      ❯ dotnet test
        Determining projects to restore...
        Restored /Users/dean/Projects/temp/osu-realm-structural-integrity/RealmStructuralIntegrity/RealmStructuralIntegrity.csproj (in 480 ms).
        RealmStructuralIntegrity -> /Users/dean/Projects/temp/osu-realm-structural-integrity/RealmStructuralIntegrity/bin/Debug/net5.0/RealmStructuralIntegrity.dll
      Test run for /Users/dean/Projects/temp/osu-realm-structural-integrity/RealmStructuralIntegrity/bin/Debug/net5.0/RealmStructuralIntegrity.dll (.NETCoreApp,Version=v5.0)
      Microsoft (R) Test Execution Command Line Tool Version 16.11.0
      Copyright (c) Microsoft Corporation.  All rights reserved.
      
      Starting test execution, please wait...
      A total of 1 test files matched the specified pattern.
      The active test run was aborted. Reason: Test host process crashed : libc++abi: terminating with uncaught exception of type realm::IncorrectThreadException: Realm accessed from incorrect thread.
      
      
      Test Run Aborted.
      

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: