googleapis / googleapis/google-cloud-cpp
Make integration tests more tolerant of transient failures
- Langage dominant
- C++
- Étoiles
- 659
- Forks
- 462
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 89
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
L’issue ne nomme aucun fichier ni test spécifique ; commencez par examiner les flakes existants liés à transient-error-on-non-idempotent-operation et regroupés ici. Rédigez le mini-design demandé, puis décomposez le travail pour chaque test d’intégration, en décidant si chaque opération doit être réessayée ou ignorée en cas d’échec transitoire ; aucun critère d’achèvement n’est spécifié au-delà du fait de rendre ces tests plus tolérants.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp, google-cloud
- Domaine
- testing
- Type d'issue
- Refactorisation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100