-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
chore: use testcontainers-go instead of containertest #16264
chore: use testcontainers-go instead of containertest #16264
Conversation
@@ -67,7 +67,5 @@ require ( | |||
|
|||
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common | |||
|
|||
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/containertest => ../../internal/containertest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to remove this line in #16209
It seems the same error than yesterday happened at the windows pipeline. Is there anything I can do to troubleshoot it? |
I opened #16267 to track the issue. I don't recall seeing this one in particular before, but we do deal with flaky tests much more frequently than we would like. Ideally we would resolve every issue but these are often difficult to reproduce/debug. We try to at least document any failures in a corresponding issue and note reoccurrences as well. If nothing else, this provides more information about what may be happening. If a failure occurs frequently we will disable the test until it is resolved. We could certainly use more help with these flaky tests. Any help or ideas for managing are welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks again @mdelapenya.
The error seems a real one in Currently looking at it 👀 |
@djaglowski I did my best trying to understand the test suite 🤞 Result is f01b5bd I noticed the test failed because the assertions were expecting an isolated Docker execution, and it could be the case that other containers are running. I'd recommend checking the current assertions regarding Docker events/stats, as they could be influenced by the existence of, i.e., the Ryuk container or other pending-to-be-pruned containers. Please take a look at f01b5bd#diff-ca81407f807d8cfe041b4a8ad51b991f51e0fcc20bfd8ff6bad32b9b9ac9e0ddR224 and f01b5bd#diff-ca81407f807d8cfe041b4a8ad51b991f51e0fcc20bfd8ff6bad32b9b9ac9e0ddR247, where I'm checking the initial count of running containers, and expecting just one more in the assertion. Same issue in f01b5bd#diff-ca81407f807d8cfe041b4a8ad51b991f51e0fcc20bfd8ff6bad32b9b9ac9e0ddR255, where I created a stub Container from the container ID. Hopefully I guessed correctly 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aerospike changes look good and pass integration tests
Mongodb receiver tests failing:
We could probably be facing "integrated tests", or tests that could eventually depend on each other's state. Will take a look at it once I have time. |
The container requests where using same fixed, exposed port, instead of using the random one. In this commit we are calculating the exposed port in the getContainer method, returning the endpoint for the container in order to be used by each test
I noticed the mongoDB test examples were using a fixed port to be exposed, and that port was the same for mongo 4.0 and 4.2. I updated the function to return the mongo container to retrieve both the container and its endpoint, calculating the dynamic, random port internally. Hope this fixes the build 🤞 |
The build failed because of the fpm install: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/3454696043/jobs/5766407878
Probably a retry on the step could help here: https://github.com/orgs/community/discussions/27121#discussioncomment-3254700 |
@mdelapenya, really appreciate your efforts on this. Given that the mongo changes go beyond what is necessary for the others, would you be willing to open a separate PR for that component? |
Sure, I can revert the commit for MongoDB and send it in a separate PR. I'm worried if, without the commit, the PR does not get merged because the mongo tests could eventually fail for the inconsistency of the used ports. If you agree with that, then't it's fine for me too :) |
This reverts commit ffe8ca5.
* main: [chore] dependabot updates Tue Nov 15 00:17:56 UTC 2022 (open-telemetry#16300) [receiver/rabbitmq] Fix flaky integration test (open-telemetry#16240) [Docker Stats Receiver] Add @jamesmoessis as code owner (open-telemetry#16253) [receiver/mongodbatlas] Alerts poll mode check hostname and port (open-telemetry#16286) [chore] update jaeger dep (open-telemetry#16287) [pkg/stanza] Fix issue where specifying a non-existent storage extension caused panic during shutdown. (open-telemetry#16213) [pkg/ottl] Rename ottllogs to ottllog (open-telemetry#16242) Register featuregate, otherwise does not work (open-telemetry#16269) [receiver/elasticsearch]: add fielddata memory size metrics on index level (open-telemetry#14922) [chore] remove what looks to be debugging code from instanaexporter (open-telemetry#16258)
…#16264) * chore: use testcontainers-go in zookeper receiver * chore: use testcontainers-go in memcached receiver * chore: use testcontainers-go in docker stats receiver * chore: use testcontainers-go in aerospike receiver * chore: use testcontainers-go in kafka metrics receiver * chore: use testcontainers-go in docker observer extension
…#16264) * chore: use testcontainers-go in zookeper receiver * chore: use testcontainers-go in memcached receiver * chore: use testcontainers-go in docker stats receiver * chore: use testcontainers-go in aerospike receiver * chore: use testcontainers-go in kafka metrics receiver * chore: use testcontainers-go in docker observer extension
Description:
This PR is replacing the internal package for managing containers lifecycle in tests with testcontainers-go. Following the same procedure as in #16209, where we updated the Redis receiver tests, we are updating:
Link to tracking Issue: #9939
Testing:
I ran each module tests with:
Documentation: No docs were updated
Follow-ups
After merging this PR, I think the
containertest
package can be removed/deprecated.