googleapis / googleapis/google-cloud-cpp
Make integration tests more tolerant of transient failures
- Ngôn ngữ chính
- C++
- Star
- 659
- Fork
- 462
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 89
Mô tả
Our integration tests often perform "non-idempotent" operations, but these can fail even if our code is working fine. A typical test may have this structure:
```cc
auto create = client.CreateFoo(....);
ASSERT_STATUS_OK(create);
auto update = client.UpdateFoo(...);
ASSERT_STATUS_OK(update);
auto del = client.DeleteFoo(...);
ASSERT_STATUS_OK(del);
```
None of those operations are retried by default, as the operations are non-idempotent. I think we could rewirte the tests as follows:
```cc
auto create = client.CreateFoo(... Options{}.set(RetryEverything()));
ASSERT_THAT(create, StatusIs(AnyOf(StatusCode::kOk, StatusCode::kAlreadyExists)));
```
Or if we don't want to retry the operation, we can write it as:
```cc
auto create = client.CreateFoo(...);
if (IsTransient(...)) GTEST_SKIP() << create.status();
```
This probably requires a mini-design doc, and will require breaking down the work per test.
For now I am going to consolidate all existing "transient error on non-idempotent operation" flakes to this one.
Hướng dẫn đóng góp
Hướng nghiên cứu
Issue không nêu tệp hoặc test cụ thể nào; hãy bắt đầu bằng việc xem xét các flake hiện có về transient-error-on-non-idempotent-operation được tổng hợp tại đây. Soạn mini-design được yêu cầu, sau đó chia nhỏ công việc theo từng integration test, quyết định xem mỗi operation nên được thử lại hay bỏ qua khi xảy ra lỗi tạm thời; không có tiêu chí hoàn thành nào được nêu ngoài việc làm cho các test này có khả năng chịu lỗi tốt hơ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ệ
- cpp, google-cloud
- Lĩnh vực
- testing
- Loại issue
- Tái cấu trúc
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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