Proposal: Add optional `threadId` to `retryAttempts` entries

未关闭
#74 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@alexshamrai 已经在做这个了。

开始于 2026年10月26日。

  • #86 来自 @alexshamrai —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
json

调研方向

Read the Attempt History Entry Object (§11), §9.25, and the schema's retryAttempts.items.properties. Update the specification and schema for the optional per-attempt threadId, including the stated unknown-thread behavior and worker identity guidance. Done when the example and schema reflect the proposal and existing 0.2.0 documents remain valid.

由索引模型根据 Issue 内容生成。

描述

Problem

Entries in retryAttempts have their own start and stop, but no threadId. The test object's threadId describes the final attempt (§9.3), so a consumer knows when an earlier attempt ran, but not on which thread or worker.

Timeline views need this. Today they have to guess, usually the final attempt's thread, and the guess is often wrong:

Producers can't add it themselves: §11 forbids unknown fields outside extra, and the schema sets additionalProperties: false on attempt items.

Proposal
  1. Add an OPTIONAL threadId (string) to the Attempt History Entry Object (§11): "Identifies the thread or worker on which this attempt executed." Same format as the test object's threadId.
  2. Reword §9.25 to "on which the final attempt executed".
  3. If an attempt entry has no threadId, its thread is unknown; it is not implied to be the test object's threadId. (Inheriting would make every existing report claim that earlier attempts ran on the final attempt's thread.)
  4. Within a document, a threadId value SHOULD identify one worker, so executions that share it ran one at a time. Producers that run tests in several processes or on several hosts SHOULD qualify it, for example fork-2/Test worker.

Schema, in retryAttempts.items.properties:

"threadId": {
  "description": "Thread or worker on which this attempt executed",
  "type": "string"
}

Example: a test that failed on one Gradle fork and passed on retry on another.

{
  "name": "checkout accepts a saved card",
  "status": "passed",
  "duration": 1200,
  "start": 1761200410000,
  "stop": 1761200411200,
  "threadId": "fork-2/Test worker",
  "retries": 1,
  "retryAttempts": [
    {
      "attempt": 1,
      "status": "failed",
      "duration": 1500,
      "start": 1761200400000,
      "stop": 1761200401500,
      "threadId": "fork-1/Test worker"
    }
  ]
}

All of this is additive; every valid 0.2.0 document stays valid.

Context

I ran into this while building a timeline report for github-test-reporter (ctrf-io/github-test-reporter#279). Related: #58 (retry model, settled in #62), #57 and #73 (attempt identity). Happy to open the spec and schema PR.

主要语言
没有语言数据
星标
103
派生
4
平均合并
1 小时 3 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

ctrf-io/ctrf 的其他 Issue

查看 ctrf-io/ctrf 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

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