Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Mar 25, 2021

This pull request configures redis coordination backend for integration tests to see if this will help with various race conditions which cause test failures we see quite often with orquesta integration tests.

@Kami Kami added this to the 3.5.0 milestone Mar 25, 2021
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Mar 25, 2021
@Kami Kami force-pushed the gha_integration_tests_redis branch from 09bb629 to 9fb22ed Compare March 25, 2021 12:38
@Kami Kami force-pushed the gha_integration_tests_redis branch from 9fb22ed to 78fb275 Compare March 25, 2021 12:41
@amanda11
Copy link
Contributor

Is this duplicate of #5052?

@Kami
Copy link
Member Author

Kami commented Mar 25, 2021

@armab Thanks - I missed that one.

In short, yeah, it's a "kinda of a duplicate.

My PR just configures it for tests, whereas that one also configures is for local development (and as such, also requires changes / updates to st2vagrantde, etc.).

For the goal is to just make those integration tests more stable and fail less often due to the race conditions.

So in short, technically we could also merge this PR earlier and then sync it up once #5052 is ready.

Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experimented with redis here:
https://github.com/st2sandbox/st2/blob/gha-service/.github/workflows/test-with-services.yml#L143-L203
I was looking for how to reconfigure it on the fly.

maybe that would be helpful

--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add --name redis so that it is easier to target in docker commands like:
docker exec redis echo command to run

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for now I just added it as a service container, but once I have some more time and once I tackle GHA workflow refactoring into multiple jobs, I will re-organize it so we only spin it up for integration tests.

At this point I don't think we get tons if we move it to a task and conditionally spin it up there since we need to refactor GHA workflow sooner or later since it's a bit messy and instead of those various ifs, we should utilize multiple jobs...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And done - added the container name (will push it once the build is done).

@Kami
Copy link
Member Author

Kami commented Mar 25, 2021

First test run with coordination backend passed, but this doesn't really mean anything.

I will change the code to run it in a loop a couple of time to see if there are any failures.

@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines. Requires some effort to review. and removed size/M PR that changes 30-99 lines. Good size to review. labels Mar 25, 2021
@pull-request-size pull-request-size bot added size/M PR that changes 30-99 lines. Good size to review. and removed size/L PR that changes 100-499 lines. Requires some effort to review. labels Mar 25, 2021
@Kami
Copy link
Member Author

Kami commented Mar 25, 2021

OK so after 6 runs it didn't fail so that's a good sign.

If there are no objections, I will go ahead and merge it. It doesn't mean it fixes the problem for 100%, but we will see over time over more test runs.


LOG.info("Using logging config: %s", logging_config_path)

LOG.info("Using coordination url: %s", cfg.CONF.coordination.url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we need to obfuscate the url if there is a password in it?

Copy link
Member Author

@Kami Kami Mar 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cognifloyd Good catch, indeed - will add tests for it and obfuscate it (or may just log the driver name).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pull-request-size pull-request-size bot removed the size/M PR that changes 30-99 lines. Good size to review. label Mar 25, 2021
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines. Requires some effort to review. label Mar 25, 2021
@Kami Kami merged commit 35cc87b into master Mar 25, 2021
@Kami Kami deleted the gha_integration_tests_redis branch March 25, 2021 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure: ci/cd size/L PR that changes 100-499 lines. Requires some effort to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants