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

未关闭
#1,951 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 小时
30 天内合并 PR
42

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

BlueQuartzSoftware/simplnx 的其他 Issue

查看 BlueQuartzSoftware/simplnx 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。