testcontainers / testcontainers/testcontainers-python
Bug: Random failures on Redis Container when DinD + parallel
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.3k
- Fork
- 386
- Merge trung bình
- 4 giờ 40 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
Describe the bug
Hey everyone,
I have a monorepo with dozens of small projects, and I am running tests that use a Redis Container in each project.
To reduce the time to run the tests (since each project tests are somewhat CPU-light), I am using gnu parallel
to run the tests of all projects in parallel, this causes situations where several containers are appearing/terminating
simultaneously. I do not have any problems running this setup locally.
However, in my CI pipeline, each is built on top of a k8s cluster that uses dind to run the containers inside the container of the CI runner, the tests are incredibly flaky, even with multiple retries. The error is always something like this:
def read_response(self, disable_decoding=False):
if not self._reader:
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
# _next_response might be cached from a can_read() call
if self._next_response is not False:
response = self._next_response
self._next_response = False
return response
if disable_decoding:
response = self._reader.gets(False)
else:
response = self._reader.gets()
while response is False:
self.read_from_socket()
if disable_decoding:
response = self._reader.gets(False)
else:
> response = self._reader.gets()
E redis.exceptions.InvalidResponse: Protocol error, got "A" as reply type byte
I am not sure if this is an issue with testcontainers, but I already spent several hours trying to find the problem.
Do you guys know what might be the source of this issue?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Không có tệp repository hoặc bài kiểm thử nào được nêu. Trước tiên, hãy tái hiện thiết lập DinD và Kubernetes bằng GNU parallel cùng nhiều container Redis, sau đó kiểm tra vòng đời của các container đồng thời với lỗi Redis client được hiển thị trong read_response. Hoàn tất khi xác định được lỗi nằm ở testcontainers hay ở thiết lập CI/container và ghi lại một cách giải quyết có thể tái hiện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, kubernetes, python, redis
- Lĩnh vực
- databases, infrastructure, testing
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100