You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all the test ledger implementation classes have a method like this (or similar) that look up the information about their own container by selecting it from the list of all running containers based on the image name.
This works when there's only ever a single container of that image is running but breaks when there are 2 or more containers with the same image (when tests are running in parallel for example).
To Reproduce
Read the code here and observe the issue:
As seen in the test ledger classes:
protectedasyncgetContainerInfo(): Promise<ContainerInfo>{
const fnTag="FabricTestLedgerV1#getContainerInfo()";constdocker=newDocker();constimage=this.getContainerImageName();constcontainerInfos=awaitdocker.listContainers({});constaContainerInfo=containerInfos.find((ci)=>ci.Image===image);if(aContainerInfo){returnaContainerInfo;}else{thrownewError(`${fnTag} no image "${image}"`);}}
Expected behavior
Container look ups are done in a way that makes it impossible to return the wrong container, e.g. based on the container ID for example.
When the container gets started/created, the test ledger class should save the resulting ID of it as a pointer to the actual container.
Also, it would be nice to pull this implementation to a more generic place such as a the Containers helper class and maybe rename it at the same time to something like getContainerInfoById(id: string): Promise<ContainerInfo>.
Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
Describe the bug
Currently all the test ledger implementation classes have a method like this (or similar) that look up the information about their own container by selecting it from the list of all running containers based on the image name.
This works when there's only ever a single container of that image is running but breaks when there are 2 or more containers with the same image (when tests are running in parallel for example).
To Reproduce
Read the code here and observe the issue:
As seen in the test ledger classes:
Expected behavior
Container look ups are done in a way that makes it impossible to return the wrong container, e.g. based on the container ID for example.
When the container gets started/created, the test ledger class should save the resulting ID of it as a pointer to the actual container.
Also, it would be nice to pull this implementation to a more generic place such as a the
Containers
helper class and maybe rename it at the same time to something likegetContainerInfoById(id: string): Promise<ContainerInfo>
.Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
769c087
cc: @jonathan-m-hamilton @sfuji822 @takeutak @jweate @suyukuoacn @RafaelAPB
The text was updated successfully, but these errors were encountered: