googleapis / googleapis/google-cloud-cpp

Make integration tests more tolerant of transient failures

Abierto
#10,413 30 comentarios 0 reacciones 0 asignados Ver en GitHub
cpp: flake type: cleanup
Lenguaje dominante
C++
Estrellas
659
Forks
462
Merge medio
1 d 2 h
PR fusionados (30 d)
89

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, google-cloud
Área
testing
Tipo de issue
Refactorización
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.