Closed minoseah629 closed 11 months ago
I have not noticed any issues on my Windows test environment.
test runner tries to continue running test, but is currently locked up. test running is locked up due to WerFault.exe is catching an error and reporting problem to Windows
Does this imply that the test keeps running infinite, or is there something causing the test process to fail (can you share the WerFault.exe
report)? Could you please look into the output of the docker ps
and docker inspect
command? My initial assumption is that the dependent container may not be initializing correctly, causing Testcontainers to wait for the readiness check confirmation (can you share the container builder configuration).
Occasionally, resetting Docker Desktop to its default factory settings can also be helpful 😅.
looks like testhost is the program that is using werfault.
at the start of the all of the test run, the test container starts up fine.
but when the 2nd or 3rd test of the whole test run, the container i am starting up with testcontainer is no longer shown in docker desktop.
i also put ConsoleLogger.Instance.DebugLogLevelEnabled = true; but not seeing logging info
I am sorry, I do not think I can help much with this information. Have you tried to reset Docker Desktop? Are you possibly exceeding the resources allocated to your test host?
but not seeing logging info
Run the tests with Debug configuration and check the test / debug window in Visual Studio (View > Output).
In addition to that, try to run dotnet test --verbosity detailed
to get a verbose output.
i have not reset docker desktop. i want to preserve my existing containers. trying code modifications
will provide a dotnet test -v:diag shortly
Microsoft (R) Test Execution Command Line Tool Version 17.7.1 (x64) Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait... A total of 1 test files matched the specified pattern. [testcontainers.org 00:00:00.05] Connected to Docker: Host: npipe://./pipe/docker_engine Server Version: 24.0.5 Kernel Version: 5.15.90.1-microsoft-standard-WSL2 API Version: 1.43 Operating System: Docker Desktop Total Memory: 15.47 GB InitializeAsync Called [testcontainers.org 00:00:00.17] Docker container 8e84a8c7fd52 created [testcontainers.org 00:00:00.23] Start Docker container 8e84a8c7fd52 [testcontainers.org 00:00:01.53] Wait for Docker container 8e84a8c7fd52 to complete readiness checks [testcontainers.org 00:00:01.54] Docker container 8e84a8c7fd52 ready [testcontainers.org 00:00:01.59] Docker container d5e4bb66c8f0 created [testcontainers.org 00:00:01.60] Start Docker container d5e4bb66c8f0 [testcontainers.org 00:00:01.92] Wait for Docker container d5e4bb66c8f0 to complete readiness checks [testcontainers.org 00:00:01.93] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container d5e4bb66c8f0 [testcontainers.org 00:00:03.05] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container d5e4bb66c8f0 [testcontainers.org 00:00:04.19] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container d5e4bb66c8f0 [testcontainers.org 00:00:04.32] Docker container d5e4bb66c8f0 ready Fi=000,Fa=000,Pe=000 # > FEATURE: GetRecentlyAccessedForUserHandlerTests Before Start Fi=000,Fa=000,Pe=001 # 1> SCENARIO: Validates QueryResults RecentlyAccessedWorkflow ReturnsCreatedWorkflow Fi=000,Fa=000,Pe=001 # 1> STEP 1/6: GIVEN There Is A Person... Fi=000,Fa=000,Pe=001 # 1> STEP 1/6: GIVEN There Is A Person (Passed after 867ms) Fi=000,Fa=000,Pe=001 # 1> STEP 2/6: AND A Workflow Exists... Fi=000,Fa=000,Pe=001 # 1> STEP 2/6: AND A Workflow Exists (Passed after 409ms) Fi=000,Fa=000,Pe=001 # 1> STEP 3/6: AND The Workflow Has A Version... Fi=000,Fa=000,Pe=001 # 1> STEP 3/6: AND The Workflow Has A Version (Passed after 1s 158ms) Fi=000,Fa=000,Pe=001 # 1> STEP 4/6: AND A Recently Accessed Exists... Fi=000,Fa=000,Pe=001 # 1> STEP 4/6: AND A Recently Accessed Exists (Passed after 92ms) Fi=000,Fa=000,Pe=001 # 1> STEP 5/6: WHEN Query Is Invoked... Before End Fi=000,Fa=000,Pe=001 # 1> STEP 5/6: WHEN Query Is Invoked (Passed after 572ms) Fi=000,Fa=000,Pe=001 # 1> STEP 6/6: THEN QueryResult IncludesRecentlyCreatedWorkflow... Fi=000,Fa=000,Pe=001 # 1> STEP 6/6: THEN QueryResult IncludesRecentlyCreatedWorkflow (Passed after 13ms) Fi=001,Fa=000,Pe=000 # 1> SCENARIO RESULT: Passed after 3s 211ms After Start [testcontainers.org 00:00:24.40] Delete Docker container d5e4bb66c8f0 After End InitializeAsync Called [testcontainers.org 00:00:26.37] Docker container 2c41df1aab76 created [testcontainers.org 00:00:26.43] Start Docker container 2c41df1aab76 [testcontainers.org 00:00:27.26] Wait for Docker container 2c41df1aab76 to complete readiness checks [testcontainers.org 00:00:27.29] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:28.55] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:29.82] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:31.14] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:32.36] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:33.65] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 2c41df1aab76 [testcontainers.org 00:00:33.86] Docker container 2c41df1aab76 ready Fi=001,Fa=000,Pe=000 # > FEATURE: GetApplicationByIdQueryTests Before Start Fi=001,Fa=000,Pe=001 # 2> SCENARIO: Validates QueryResults WhenDataIsSetup AndShowArchived [showArchived: "False"] Fi=001,Fa=000,Pe=001 # 2> STEP 1/3: GIVEN A CoordinationGroupExists [isArchived: "False"]... Fi=001,Fa=000,Pe=001 # 2> STEP 1/3: GIVEN A CoordinationGroupExists [isArchived: "False"] (Passed after 474ms) Fi=001,Fa=000,Pe=001 # 2> STEP 2/3: WHEN Query Is Invoked [showArchived: "False"]... Fi=001,Fa=000,Pe=001 # 2> STEP 2/3: WHEN Query Is Invoked [showArchived: "False"] (Passed after 145ms) Fi=001,Fa=000,Pe=001 # 2> STEP 3/3: THEN QueryResult ShouldBeAccurate... Fi=001,Fa=000,Pe=001 # 2> STEP 3/3: THEN QueryResult ShouldBeAccurate (Passed after 5ms) Fi=002,Fa=000,Pe=000 # 2> SCENARIO RESULT: Passed after 664ms After Start Before Start Fi=002,Fa=000,Pe=001 # 3> SCENARIO: Validates QueryResults WhenDataIsSetup AndShowArchived [showArchived: "True"] Fi=002,Fa=000,Pe=001 # 3> STEP 1/3: GIVEN A CoordinationGroupExists [isArchived: "True"]... After End Fi=002,Fa=000,Pe=001 # 3> STEP 1/3: GIVEN A CoordinationGroupExists [isArchived: "True"] (Passed after 363ms) Fi=002,Fa=000,Pe=001 # 3> STEP 2/3: WHEN Query Is Invoked [showArchived: "True"]... Fi=002,Fa=000,Pe=001 # 3> STEP 2/3: WHEN Query Is Invoked [showArchived: "True"] (Passed after 64ms) Fi=002,Fa=000,Pe=001 # 3> STEP 3/3: THEN QueryResult ShouldBeAccurate... Fi=002,Fa=000,Pe=001 # 3> STEP 3/3: THEN QueryResult ShouldBeAccurate (Passed after <1ms) Fi=003,Fa=000,Pe=000 # 3> SCENARIO RESULT: Passed after 455ms After Start [testcontainers.org 00:00:39.04] Delete Docker container 2c41df1aab76 <!---- InitializeAsync Called [testcontainers.org 00:00:40.76] Docker container 92aedef3a25f created [testcontainers.org 00:00:40.81] Start Docker container 92aedef3a25f [testcontainers.org 00:00:41.57] Wait for Docker container 92aedef3a25f to complete readiness checks [testcontainers.org 00:00:41.62] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 92aedef3a25f [testcontainers.org 00:04:14.52] Execute "/bin/sh -c true && (grep -i ':01538' /proc/net/tcp || nc -vz -w 1 localhost 5432 || /bin/bash -c '</dev/tcp/localhost/5432')" at Docker container 92aedef3a25f
Passed! - Failed: 0, Passed: 3, Skipped: 0, Total: 3, Duration: 15 s - xxx.Coordination.IntegrationTests.dll (net7.0)
total of 16 tests in test project
interesting.
removing [assembly: CollectionBehavior(DisableTestParallelization = true, MaxParallelThreads = 2)] got me working again. i thought i saw something to ensure 1 process is running database connections.
I'm having the same issue. Sadly I don't get any logs to post here.
The Ryuk container does start (logs exist) but it fails to start my custom container (Typesense). It takes about 60s until the StartAsync
is finished and then I get an exception:
Unhandled exception. System.InvalidOperationException: Could not find resource 'TypesenseContainer'. Please create the resource by calling StartAsync(CancellationToken) or CreateAsync(CancellationToken).
brickhub-backend-1 | at DotNet.Testcontainers.Guard.ThrowIf[TType](ArgumentInfo`1& argument, Func`2 condition, Func`2 ifClause)
brickhub-backend-1 | at DotNet.Testcontainers.Resource.ThrowIfResourceNotFound()
brickhub-backend-1 | at DotNet.Testcontainers.Containers.DockerContainer.GetMappedPublicPort(String containerPort)
brickhub-backend-1 | at DotNet.Testcontainers.Containers.DockerContainer.GetMappedPublicPort(Int32 containerPort)
My setup is a little more complex, I try to start the testcontainer from within another container in a docker compose. Yes I did mount the volume for docker:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Funnily enough this issue does not occur when running the app natively (not from within the docker container). I also noticed that the container is never created - so this is not an issue with the WaitStrategy
Any way you can help me or for me to debug this behavior?
This looks like a Compose configuration. Did you set the environment variable mentioned here: https://dotnet.testcontainers.org/examples/dind/#compose? The Wormhole configuration varies a bit for each environment. I need more information about your setup if it is still not working.
@HofmeisterAn thank you! I missed that part...
Testcontainers version
3.3.0 and 3.5.0
Using the latest Testcontainers version?
Yes
Host OS
Windows 11
Host arch
x64
.NET version
7.0.400
Docker version
Docker info
What happened?
run a test in visual studio or dotnet test 1-2 tests would pass fine test runner tries to continue running test, but is currently locked up. test running is locked up due to WerFault.exe is catching an error and reporting problem to Windows
also happening on coworker's machine.
can provide video if requested
Relevant log output
Additional information
No response