Skip to content
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

Flaky tests on ShouldReturnsCorrectStatusContractWhenBadMessageIsEmitted #44

Closed
SebastienDegodez opened this issue Feb 4, 2025 · 6 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@SebastienDegodez
Copy link
Member

Describe the bug

On the last commit, we have an error again 🥵. I don't see where this one comes from ...

Assert.False(testResult.InProgress);

You don't have the test in java, is it possible that it's microcks that don't define "InProgress"?
Should the assert be removed from the test ?

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

https://github.com/microcks/microcks-testcontainers-dotnet/actions/runs/13133862878/job/36644773078#step:10:223

[xUnit.net 00:02:11.64]     Microcks.Testcontainers.Tests.Async.MicrocksAsyncFeatureTest.ShouldReturnsCorrectStatusContractWhenBadMessageIsEmitted [FAIL]
  Failed Microcks.Testcontainers.Tests.Async.MicrocksAsyncFeatureTest.ShouldReturnsCorrectStatusContractWhenBadMessageIsEmitted [1 m 11 s]
  Error Message:
   Assert.False() Failure
Expected: False
Actual:   True
  Stack Trace:
     at Microcks.Testcontainers.Tests.Async.MicrocksAsyncFeatureTest.ShouldReturnsCorrectStatusContractWhenBadMessageIsEmitted() in /home/runner/work/microcks-testcontainers-dotnet/microcks-testcontainers-dotnet/tests/Microcks.Testcontainers.Tests/Async/MicrocksAsyncFeatureTest.cs:line 146
--- End of stack trace from previous location ---

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

No response

@SebastienDegodez SebastienDegodez added the kind/bug Something isn't working label Feb 4, 2025
@lbroudoux
Copy link
Member

lbroudoux commented Feb 4, 2025

inProgress should be always there as it has a default value that is false and as it's a primitive, it can't be null. How can you easily print the whole testResult?

Similarly, it can be helpful to print the containers logs as well to check if it's not a race condition (the async minion may take more time to report the result to the main container). See https://github.com/microcks/microcks-testcontainers-java/blob/main/src/main/java/io/github/microcks/testcontainers/MicrocksContainer.java#L430 where we add an extra second for avoiding this issue. Shouldn't we have this same thing here: https://github.com/microcks/microcks-testcontainers-dotnet/blob/main/src/Microcks.Testcontainers/MicrocksContainerExtensions.cs#L107 ?

@SebastienDegodez
Copy link
Member Author

inProgress should be always there as it has a default value that is false and as it's a primitive, it can't be null. How can you easily print the whole testResult?

Similarly, it can be helpful to print the containers logs as well to check if it's not a race condition (the async minion may take more time to report the result to the main container). See https://github.com/microcks/microcks-testcontainers-java/blob/main/src/main/java/io/github/microcks/testcontainers/MicrocksContainer.java#L430 where we add an extra second for avoiding this issue. Shouldn't we have this same thing here: https://github.com/microcks/microcks-testcontainers-dotnet/blob/main/src/Microcks.Testcontainers/MicrocksContainerExtensions.cs#L107 ?

AtMost with log

And set ConsoleLogger.Instance.DebugLogLevelEnabled to true in code.

https://dotnet.testcontainers.org/custom_configuration/#enable-logging

@lbroudoux
Copy link
Member

Looks like we can close this one now that #49 has been merged. @SebastienDegodez Is it ok for you?

@lbroudoux lbroudoux added this to the 0.3.0 milestone Mar 11, 2025
@SebastienDegodez
Copy link
Member Author

I hope my fix is ​​sufficient. I can't reproduce on my computer.

@SebastienDegodez
Copy link
Member Author

I hope my fix is ​​sufficient. I can't reproduce on my computer.

I have run several builds, I feel like it is better.

@lbroudoux
Copy link
Member

Yep, you now things: "release early and break early". Let's go and close it!

@lbroudoux lbroudoux changed the title Flaky tests Flaky tests on ShouldReturnsCorrectStatusContractWhenBadMessageIsEmitted Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants