Hi,
I have this really weird behaviour where testcontainers are reused but not always. If the container was just started, running my test again never starts a new one, but after a moment, about 5 minutes, it always creates a new one.
A little debugging session led me to the hash method in GenericContainer class.
It appears the createCommand used to generate that hash, contains docker auth elements.
Under the key authConfig, I think the key password contains the docker registry token because the username is _dcgcloud_token (using a google artifact registry as a docker registry).
The token being renewed automatically every now and then it breaks the container reusability.
As I see it we could simply remove this key from the command just before generating the hash, would that make sense to you ?
Hi,
I have this really weird behaviour where testcontainers are reused but not always. If the container was just started, running my test again never starts a new one, but after a moment, about 5 minutes, it always creates a new one.
A little debugging session led me to the
hashmethod inGenericContainerclass.It appears the
createCommandused to generate that hash, contains docker auth elements.Under the key
authConfig, I think the keypasswordcontains the docker registry token because the username is_dcgcloud_token(using a google artifact registry as a docker registry).The token being renewed automatically every now and then it breaks the container reusability.
As I see it we could simply remove this key from the command just before generating the hash, would that make sense to you ?