Closed afiqsyed closed 2 months ago
This is an issue in Docker.DotNet. Does your code change Json.NET's DefaultSettings
somewhere? Right now, I assume that the first test changes the static Json.NET's default settings, and as a result, the second test fails because instantiating a new DockerClient
and the necessary JsonConvert
results in a broken configuration (or something like that). Still wondering how CanConvert(Type)
returns true
. I looked into Docker.DotNet but cannot reproduce it.
Which version of Newtonsoft.Json
are you using?
@HofmeisterAn I manage to resolve this issue by updating Microsoft.AspNetCore.Mvc.Testing from version 8.0.0 to 8.0.8
Oh, that is unexpected. Does it include a known fix? Do you know of any related issues?
Testcontainers version
3.10.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
.NET version
8.0
Docker version
Docker info
What happened?
When running two integration tests using the Testcontainers.MsSql library, the first test passes, but the second test consistently fails with a
System.NotImplementedException
. The error is related to deserializingSystem.DateTimeOffset
back toSystem.DateTime
. I tried to run the test one by one, both tests are passing. Problem happened when I tried to execute both tests together.This is how I build my testcontainer in the constructor of the test class
I'm using Xunit, so I start my mssql testcontainer on InitializeAsync() and dispose it on DisposeAsync()
Here are how my tests look like. Both tests are actually the same, I just try to reproduce this issue.
Relevant log output
Additional information
No response