Skip to content

[TEST] test improvements#251

Draft
paulomach wants to merge 10 commits into8.0/edgefrom
misc/test_improvements
Draft

[TEST] test improvements#251
paulomach wants to merge 10 commits into8.0/edgefrom
misc/test_improvements

Conversation

@paulomach
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Apr 17, 2026
The force_quorum method check for other instances connectivity, so it will fail.
Keep then frozen
Comment on lines +2374 to +2381
# TODO: modify/expose timeout in the mysql-shell-client library
address = f"{instance_def}:3306"
command = "\n".join((
f"cluster = dba.get_cluster('{self.cluster_name}')",
f"cluster.force_quorum_using_partition_of('{address}')",
))

executor = self._build_cluster_tcp_executor(self.instance_address)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sinclert-canonical , testing this here, but how should we expose timeout at this level?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At the moment, timeouts can only be applied in an operation-per-operation basis, in the BaseExecutor subclasses (see code). That means that timeouts can only be applied when manually executing the Python / SQL operations via an executor class.

I originally thought about exposing this argument one level up the chain, in the client classes, but it feels noisy to do in an operation-per-operation basis (i.e. every class method will have an additional arg), and a bit overkill in their constructors, as not every operation should have the same timeout.

Open to ideas.

Comment on lines +111 to +126
def wait_model_1():
model_1.wait(
ready=wait_for_apps_status(jubilant_backports.all_active, MYSQL_APP_1),
timeout=10 * MINUTE_SECS,
)

def wait_model_2():
model_2.wait(
ready=wait_for_apps_status(jubilant_backports.all_active, MYSQL_APP_2),
timeout=10 * MINUTE_SECS,
)

with ThreadPoolExecutor() as executor:
futures = [executor.submit(wait_model_1), executor.submit(wait_model_2)]
for future in futures:
future.result()
Copy link
Copy Markdown
Contributor

@astrojuanlu astrojuanlu Apr 23, 2026

Choose a reason for hiding this comment

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

I'm curious, what does this accomplish? Practically speaking, the execution won't go past this point until both .wait calls return, which is what the sequential code does too.

constraints=constraints,
)

model_1.deploy(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants