ENH: Replace test hooks in simplnx production code with real failures where they are reliable

Abierto
#1,951 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
backend, testing

Línea de trabajo

Start by inventorying the hooks named in the issue and the tests that use them, including the persistence, bounded-read and selected-import areas. For each hook, determine whether a real failure reliably reaches the same step on Linux, Windows and macOS CI. Replace and remove hooks only when that path is reliable and simplifies both test and production code; keep hooks for the listed failure cases that real failures cannot reliably reach.

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

Descripción

enhancement Testing

Summary

Replace test hooks in simplnx production code with real failures where a real failure reliably reaches the same step, and remove the hooks that this replaces. This is a follow-up to the out-of-core review PR tree, mainly #1933 (checked flush), #1934 (selected import) and #1935 (bounded reads). Those PRs keep their hooks, and the review decided to do this work here, hook by hook.

How it works now

Many failure tests use fault injection that is compiled into the production libraries when SIMPLNX_BUILD_TESTS is ON. Examples:

  • ParallelChunkCodec.hpp: SetCodecIoObserverForTesting, InjectCodecFaultForTesting, the LegacyPayload...ForTesting scopes and the SIMPLNX_OBSERVE_* macros that wrap HDF5 calls.
  • ImportH5ObjectPathsAction.hpp: setPublicationFaultForTesting and related functions. Most of these go away with the smaller selected-import design (separate issue).
  • GroupIO.hpp: FailNextGroupConstructionForTesting.
  • WindingTransferWarnings.hpp: SetWindingWarningFailureForTesting and MaybeFailWindingWarningForTesting.
  • IdentifySampleCCL.hpp: the slice observer, extra allocation and diagnostic controls.
  • BoundedRead.hpp: MakeSuccessWarningsForTesting.

The hooks add code, state and exported functions to shipping headers, and tests that depend on them break when the code is simplified. Once DREAM3D-NX BlueQuartzSoftware/DREAM3DNX#1247 merges, release presets build with SIMPLNX_BUILD_TESTS OFF, so the hooks will not be in shipped libraries.

Requested change

For each hook:

  • Replace it with a real failure (a read-only or missing file, a removed group, a corrupted compressed chunk, a directory that cannot be created) when that failure reliably reaches the intended step on Linux, Windows and macOS CI, and when the change makes the test and the production code simpler. Then remove the hook.
  • Keep it when no real failure reliably reaches the step. Examples: a failure after publication or during rollback, a second-chunk read failure, a failure during cleanup or checked close, two failures at once, and allocation failures.
  • Do not weaken the failure assertions, and do not add a new abstraction only to remove hooks.

Which hooks can be replaced is still open. The first step is an inventory of each hook, the tests that use it, and whether a real failure reaches the same step.

The design reviews list this as persistence D7, bounded-reads D4 and selected-import D7. The SimplnxOoc hooks are a separate issue in that repository.

Lenguaje dominante
C++
Estrellas
18
Forks
15
Merge medio
4 d 23 h
PR fusionados (30 d)
42

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BlueQuartzSoftware/simplnx

Todos los issues de BlueQuartzSoftware/simplnx

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.