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

[Bug]: lack of control over hook processing #2663

Open
stevenh opened this issue Jul 20, 2024 · 0 comments
Open

[Bug]: lack of control over hook processing #2663

stevenh opened this issue Jul 20, 2024 · 0 comments
Labels
bug An issue with the library

Comments

@stevenh
Copy link
Collaborator

stevenh commented Jul 20, 2024

Testcontainers version

0.32.0

Using the latest Testcontainers version?

Yes

Host OS

N/A

Host arch

N/A

Go version

N/A

Docker version

N/A

Docker info

N/A

What happened?

When writing a container module developers can easily assume that hooks are processed in the order given and that if a failure occurs this will prevent subsequent hooks being called however this is not the case.

When hooks are added depending on pre or post they are order differently and depending on the type of the hook some fail fast and some execute all which is confusing to the user.

We need to look at the way these are handled and either ensure its clearer or provide control such as fatal error processing or always failing fast.

As an example of this the kafka module has two PostStarts hooks, the first sets up the container config the second waits for it to be ready. Unfortunately if the copy fails the wait is still run, meaning its a long time till the user gets the result which is a timeout.

#2653 is related to this.

Relevant log output

No response

Additional information

No response

@stevenh stevenh added the bug An issue with the library label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

No branches or pull requests

1 participant