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 testcontainers tests #4710

Open
ndr-brt opened this issue Jan 9, 2025 · 0 comments
Open

flaky testcontainers tests #4710

ndr-brt opened this issue Jan 9, 2025 · 0 comments
Labels
feature_request New feature request, awaiting triage flaky test triage all new issues awaiting classification

Comments

@ndr-brt
Copy link
Member

ndr-brt commented Jan 9, 2025

Feature Request

Looks like we have some flaky tests, caused by the way we are using testcontainers.
An analysis on the issue has been made in the tractus-x edc context:

every test that involves testcontainers in fact could cause issues, because testcontainers itself spins up a connector with an exposed port, and this happens always after the getFreePort is called, here's the suspect:

301c3c46fe23   testcontainers/ryuk:0.11.0   "/bin/ryuk"              29 seconds ago   Up 28 seconds      0.0.0.0:49158->8080/tcp, :::49158->8080/tcp                           testcontainers-ryuk-5b664308-1f43-4381-962d-ed6531f5c6ef

the port that it uses is generated randomly after the getFreePort is called to define the connector configuration but before the connectors are actually started, like:

  • EDC test runtime defines ports to be used by choosing not used ones
  • testcontainers spins up a container that could use one of the ports already defined by the EDC test runtime
  • EDC test runtime spins up the runtimes, that could break because one of the port has been used by testcontainers

(ref. eclipse-tractusx/tractusx-edc#1027 (comment))

Which Areas Would Be Affected?

end to end tests

Why Is the Feature Desired?

avoid test flakyness

Solution Proposal

  • spin testcontainers before defining ports to be used (so make them not statically generated as it is now)
  • force the ryuk port to be generated by getFreePort (if that's possible)
@ndr-brt ndr-brt added flaky test feature_request New feature request, awaiting triage triage all new issues awaiting classification labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request New feature request, awaiting triage flaky test triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

1 participant