googleapis / googleapis/google-cloud-cpp

Make integration tests more tolerant of transient failures

未关闭
#10,413 30 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
cpp: flake type: cleanup
主要语言
C++
星标
659
派生
462
平均合并
1 天 2 小时
30 天内合并 PR
89

描述

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.

贡献指南

打开贡献指南

调研方向

该 issue 未指定文件或具体测试;请先查看此处汇总的现有 transient-error-on-non-idempotent-operation flakes。起草所要求的 mini-design,然后按每个集成测试拆分工作,决定每个操作在发生暂时性失败时应重试还是跳过;除使这些测试更加宽容之外,未指定其他完成标准。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, google-cloud
领域
testing
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。