-
-
Notifications
You must be signed in to change notification settings - Fork 593
feat: make port mapping checks timeout configurable #3176
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
Changes from all commits
f1415e6
e6ea364
c603baf
240b622
613b0ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -85,6 +85,11 @@ type Config struct { | |||||
| // | ||||||
| // Environment variable: TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE | ||||||
| TestcontainersHost string `properties:"tc.host,default="` | ||||||
|
|
||||||
| // TestcontainersPortMappingTimeout is the time to wait before all the exposed ports are mapped. | ||||||
| // | ||||||
| // Environment variable: TESTCONTAINERS_PORT_MAPPING_TIMEOUT | ||||||
| TestcontainersPortMappingTimeout time.Duration `properties:"tc.port.mapping.timeout,default=5s"` | ||||||
| } | ||||||
|
|
||||||
| // } | ||||||
|
|
@@ -141,6 +146,11 @@ func read() Config { | |||||
| config.RyukConnectionTimeout = timeout | ||||||
| } | ||||||
|
|
||||||
| testcontainersPortMappingTimeoutEnv := readTestcontainersEnv("TESTCONTAINERS_PORT_MAPPING_TIMEOUT") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This value is used in What if we use different name (I'm not good in naming), like:
Suggested change
? |
||||||
| if timeout, err := time.ParseDuration(testcontainersPortMappingTimeoutEnv); err == nil { | ||||||
| config.TestcontainersPortMappingTimeout = timeout | ||||||
| } | ||||||
|
|
||||||
| return config | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
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.
question: In the standard case 5s might sound generous but if a system is underload this could cause issues, what lead to choice of 5s as the default?