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

オープン
#1,951 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend, testing

調査の方向性

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.

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

説明

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.

主要言語
C++
スター
18
フォーク
15
平均マージ
4日 23時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BlueQuartzSoftware/simplnx のほかの issue

BlueQuartzSoftware/simplnx の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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