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

Thread safety when connecting to instances in system tests #3775

Open
patchwork01 opened this issue Nov 22, 2024 · 0 comments
Open

Thread safety when connecting to instances in system tests #3775

patchwork01 opened this issue Nov 22, 2024 · 0 comments

Comments

@patchwork01
Copy link
Collaborator

patchwork01 commented Nov 22, 2024

Background

Split from:

In the JUnit-based system test suite, each test starts by connecting to an instance of Sleeper. The first time an instance is connected to in a test suite, it may not exist in which case it will be deployed, or if it already exists, it may be updated if necessary. Further tests connecting to the instance will not cause this.

Description

We'd like to ensure thread safety when connecting to an instance of Sleeper in a system test.

This should remove a restriction preventing us from running multiple system tests in parallel.

Analysis

We could have one thread that's responsible for interacting with the current state of which instances have been connected to and which are currently being deployed.

When a test connects to an instance, it can make an asynchronous call to that thread via a single-threaded ExecutorService. Once in the one thread, this call can check whether the state of the instance is known. If not, it can kick off a deployment and subscribe the test to the deployment. If it's deploying, it can subscribe the test to the deployment in progress. If it's already deployed, it can return immediately.

We could have a separate thread pool for deploying instances, so a number of instances can be deployed at the same time.

@patchwork01 patchwork01 added this to the 0.29.0 milestone Nov 22, 2024
@patchwork01 patchwork01 changed the title Connect to instances in system tests in parallel Connect to instances in system tests thread safely Nov 22, 2024
@patchwork01 patchwork01 changed the title Connect to instances in system tests thread safely Connect to instances in system tests with thread safety Nov 22, 2024
@patchwork01 patchwork01 changed the title Connect to instances in system tests with thread safety Thread safety when connecting to instances in system tests Nov 22, 2024
@patchwork01 patchwork01 modified the milestones: 0.29.0, 0.28.0 Dec 16, 2024
@patchwork01 patchwork01 modified the milestones: 0.28.0, 0.29.0 Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant