googleapis / googleapis/google-cloud-cpp

Make integration tests more tolerant of transient failures

オープン
#10,413 コメント 30 件 リアクション 0 件 担当者 0 名 GitHub で見る
cpp: flake type: cleanup
主要言語
C++
スター
659
フォーク
462
平均マージ
1日 2時間
マージ済み PR(30日)
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue names no files or specific tests; begin by reviewing the existing transient-error-on-non-idempotent-operation flakes consolidated here. Draft the requested mini-design, then break the work down per integration test, deciding whether each operation should retry or skip on transient failure; completion criteria are not specified beyond making these tests more tolerant.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, google-cloud
領域
testing
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。