-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception 'System.Runtime.InteropServices.SEHException' #1865
Comments
I get this error when trying to use Realm with xUnit. nUnit doesn't complain however. |
Hey @Jared-Aus, can you upload a small project that reproduces the crash? |
Done. Btw, I haven't noticed any issues in my Xamarin or nUnit projects, however it's possible that xUnit is simply less forgiving than the others. |
I was able to reproduce this, thanks. |
No problems, and yes, that was my experience too. |
I have the same issue; running a simple test of querying against an empty Realm with an InMemoryConfiguration successfully queries, and then throws an SEHException:
Has anyone found a fix to put in the teardown to allow for writing xUnit tests with Realm? |
I've hit the same issue with xUnit. As others have observed the test cases run fine, but once done the issue manifests 100% of the time.
From the trace I managed to pinpoint where the exception is raised.
Based on the .NET documentation for the
If able to catch that exception, we'll likely be closer to fixing this. Version of Realm and ToolingRealm 5.1.2 (via NuGet) |
I have just got the same issue. What actually worked for me is when you return |
My guess is that the synchronization context that xunit installs by default gets into an invalid state after the test completes, which means that if Realm tries to invoke anything from it, it will fail. This probably works with the async test because the synchronization context it installs for those behaves differently on teardown. We should try to repro and probably wrap the method calls in |
Goals
I'm using RealmDb with my wpf application . sometimes the database will throw an exception ,I don't know how to reproduce it.
Expected Results
succeed
Actual Results
Steps to Reproduce
I don't know how to reproduce this problem.
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: