Repository navigation
feat: draw retry attempts on the thread they record - #351
Merged
Ma11hewThomas merged 1 commit intoNov 27, 2026
Merged
Conversation
CTRF 0.3.0 lets a retryAttempts entry record the thread or worker that ran it. The timeline now draws each run before a retry on that thread, packed with the thread's final results, so a thread whose tests overlap is split into lanes as for final results. Runs that record no thread keep today's placement on their test's thread, and only they can end up in the "Runs before a retry" lane. Earlier results of a test that ran again record their thread too and are packed the same way. The self-test sample moves to CTRF 0.3.0 and records the worker of its failed attempt. Closes ctrf-io#334
Contributor
Author
|
@Ma11hewThomas this is the follow-up to ctrf-io/ctrf#86: the timeline now uses the attempt threadId from CTRF 0.3.0. Could you please take a look when you have time? Thanks in advance! |
Contributor
|
Thank you again! To be included in next release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #334
CTRF 0.3.0 adds an optional
threadIdtoretryAttemptsentries (ctrf-io/ctrf#86), so each earlier attempt of a retried test can record the thread or worker that ran it. The timeline now draws each run before a retry on that thread, instead of guessing.What changes
threadIdrender exactly as before. For the current sample report, and for the second example below without the field,mainand this branch produce identical timeline data.Examples
Both charts in each example come from the same CTRF report, rendered by the timeline code on
mainand on this branch. Numbers on bars point to the test timings table, which is left out here.🟩 passed · 🟥 failed · 🟨 failed, then retried (dashed) ·♦️ failed too fast for a bar · 0:00 = 2026-01-01 08:00:00.000 UTC
The self-test sample
In
ctrf-reports/timeline/ctrf-report.json, "should reset the password by email" failed onworker-3, then passed onworker-0. This PR adds"threadId": "worker-3"to its failed attempt and moves the sample to CTRF 0.3.0.Before: the failed attempt (yellow, dashed) is drawn in a gap on
worker-0, which then reads 99% busy.--- config: gantt: displayMode: compact useWidth: 1000 leftPadding: 79 rightPadding: 40 themeCSS: ".taskText.critText0,.taskText.critText1,.taskText.critText2,.taskText.critText3{fill:#ffffff !important}.active0,.active1,.active2,.active3{stroke-dasharray:4 2}" themeVariables: taskBkgColor: '#4ac26b' taskBorderColor: '#1a7f37' critBkgColor: '#cf222e' critBorderColor: '#82071e' activeTaskBkgColor: '#eac54f' activeTaskBorderColor: '#9a6700' doneTaskBkgColor: '#afb8c1' doneTaskBorderColor: '#6e7781' taskTextColor: '#1f2328' taskTextDarkColor: '#1f2328' sectionBkgColor: '#8c959f' sectionBkgColor2: '#8c959f' vertLineColor: '#8c959f' --- gantt accTitle: Test execution timeline accDescr: 16 tests and 1 run before a retry on 4 threads over 34.2s, 2 failed. The slowest test is should generate the sales report (26.0s on worker-2). The last to finish is should export orders as CSV on worker-0, at 0:34.200. dateFormat D HH:mm:ss.SSS axisFormat %-M:%S todayMarker off section worker-0 :16 00:00:00.000, 0ms should log in w… :16 00:00:00.000, 4200ms should lock the account… :16 00:00:04.300, 6100ms 1 :active, 16 00:00:10.500, 2600ms 2 :16 00:00:13.200, 1900ms should show the order history :16 00:00:15.200, 15800ms should exp… :16 00:00:31.100, 3100ms :16 00:00:34.200, 0ms section worker-1 should register a new user :16 00:00:00.000, 9434ms :crit, milestone, 16 00:00:09.900, 0ms should apply a dis… :16 00:00:10.366, 4784ms should pay with a saved card :crit, 16 00:00:15.300, 7700ms 3 :16 00:00:23.100, 2400ms section worker-2 4 :16 00:00:00.000, 1200ms 5 :16 00:00:01.300, 800ms should generate the sales report :16 00:00:02.200, 26000ms section worker-3 should sear… :16 00:00:00.000, 3400ms should fil… :16 00:00:03.500, 2900ms 6 :16 00:00:06.500, 2100msAfter: the attempt is on
worker-3, after "should sort by rating", andworker-0shows its real idle time.--- config: gantt: displayMode: compact useWidth: 1000 leftPadding: 79 rightPadding: 40 themeCSS: ".taskText.critText0,.taskText.critText1,.taskText.critText2,.taskText.critText3{fill:#ffffff !important}.active0,.active1,.active2,.active3{stroke-dasharray:4 2}" themeVariables: taskBkgColor: '#4ac26b' taskBorderColor: '#1a7f37' critBkgColor: '#cf222e' critBorderColor: '#82071e' activeTaskBkgColor: '#eac54f' activeTaskBorderColor: '#9a6700' doneTaskBkgColor: '#afb8c1' doneTaskBorderColor: '#6e7781' taskTextColor: '#1f2328' taskTextDarkColor: '#1f2328' sectionBkgColor: '#8c959f' sectionBkgColor2: '#8c959f' vertLineColor: '#8c959f' --- gantt accTitle: Test execution timeline accDescr: 16 tests and 1 run before a retry on 4 threads over 34.2s, 2 failed. The slowest test is should generate the sales report (26.0s on worker-2). The last to finish is should export orders as CSV on worker-0, at 0:34.200. dateFormat D HH:mm:ss.SSS axisFormat %-M:%S todayMarker off section worker-0 :16 00:00:00.000, 0ms should log in w… :16 00:00:00.000, 4200ms should lock the account… :16 00:00:04.300, 6100ms 1 :16 00:00:13.200, 1900ms should show the order history :16 00:00:15.200, 15800ms should exp… :16 00:00:31.100, 3100ms :16 00:00:34.200, 0ms section worker-1 should register a new user :16 00:00:00.000, 9434ms :crit, milestone, 16 00:00:09.900, 0ms should apply a dis… :16 00:00:10.366, 4784ms should pay with a saved card :crit, 16 00:00:15.300, 7700ms 2 :16 00:00:23.100, 2400ms section worker-2 3 :16 00:00:00.000, 1200ms 4 :16 00:00:01.300, 800ms should generate the sales report :16 00:00:02.200, 26000ms section worker-3 should sear… :16 00:00:00.000, 3400ms should fil… :16 00:00:03.500, 2900ms 5 :16 00:00:06.500, 2100ms 6 :active, 16 00:00:10.500, 2600msRetries that moved to another worker
"should pay with a saved card" failed on
worker-2right after "should empty the cart", then passed onworker-0. "should suggest products while typing" failed onworker-3, which was replaced byworker-4, where the retry passed.Before: the saved-card attempt overlaps tests on
worker-0, so it gets a row of its own, andworker-2looks idle after "should empty the cart". The suggestions attempt is drawn onworker-4before that worker started. The report adds this note:--- config: gantt: displayMode: compact useWidth: 1000 leftPadding: 142 rightPadding: 40 themeCSS: ".taskText.critText0,.taskText.critText1,.taskText.critText2,.taskText.critText3{fill:#ffffff !important}.active0,.active1,.active2,.active3{stroke-dasharray:4 2}" themeVariables: taskBkgColor: '#4ac26b' taskBorderColor: '#1a7f37' critBkgColor: '#cf222e' critBorderColor: '#82071e' activeTaskBkgColor: '#eac54f' activeTaskBorderColor: '#9a6700' doneTaskBkgColor: '#afb8c1' doneTaskBorderColor: '#6e7781' taskTextColor: '#1f2328' taskTextDarkColor: '#1f2328' sectionBkgColor: '#8c959f' sectionBkgColor2: '#8c959f' vertLineColor: '#8c959f' --- gantt accTitle: Test execution timeline accDescr: 15 tests and 2 runs before a retry on 5 threads and 1 more lane over 14.3s, 0 failed. The slowest test is should register a new user (6.0s on worker-1). The last to finish is should send the receipt on worker-4, at 0:14.300. dateFormat D HH:mm:ss.SSS axisFormat %-M:%S todayMarker off section worker-0 :16 00:00:00.000, 0ms should log in with valid credentials :16 00:00:00.000, 4200ms should update the profile :16 00:00:04.300, 4700ms should pay with a saved card :16 00:00:09.100, 3500ms 1 :16 00:00:12.700, 1300ms :16 00:00:14.300, 0ms section worker-1 should register a new user :16 00:00:00.000, 6000ms should search by product name :16 00:00:06.100, 3400ms should filter by price :16 00:00:09.600, 2400ms should sort by rat… :16 00:00:12.100, 2100ms section worker-2 should empty the cart :16 00:00:00.000, 2900ms should keep the cart after… :16 00:00:07.500, 2900ms should apply a discount code :16 00:00:10.500, 3600ms section worker-3 should show the order history :16 00:00:00.000, 4900ms section worker-4 should sugg… :active, 16 00:00:05.000, 1500ms 2 :16 00:00:06.700, 1300ms should export orders as CSV :16 00:00:08.100, 3700ms should send the rece… :16 00:00:11.900, 2400ms section Runs before a retry should pay with a saved card (attempt 1) :active, 16 00:00:02.950, 4450msAfter: both attempts are on the workers that ran them, and the extra row and its note are gone. The failed saved-card attempt now sits next to the test that ran just before it on the same worker.
--- config: gantt: displayMode: compact useWidth: 1000 leftPadding: 79 rightPadding: 40 themeCSS: ".taskText.critText0,.taskText.critText1,.taskText.critText2,.taskText.critText3{fill:#ffffff !important}.active0,.active1,.active2,.active3{stroke-dasharray:4 2}" themeVariables: taskBkgColor: '#4ac26b' taskBorderColor: '#1a7f37' critBkgColor: '#cf222e' critBorderColor: '#82071e' activeTaskBkgColor: '#eac54f' activeTaskBorderColor: '#9a6700' doneTaskBkgColor: '#afb8c1' doneTaskBorderColor: '#6e7781' taskTextColor: '#1f2328' taskTextDarkColor: '#1f2328' sectionBkgColor: '#8c959f' sectionBkgColor2: '#8c959f' vertLineColor: '#8c959f' --- gantt accTitle: Test execution timeline accDescr: 15 tests and 2 runs before a retry on 5 threads over 14.3s, 0 failed. The slowest test is should register a new user (6.0s on worker-1). The last to finish is should send the receipt on worker-4, at 0:14.300. dateFormat D HH:mm:ss.SSS axisFormat %-M:%S todayMarker off section worker-0 :16 00:00:00.000, 0ms should log in with valid credentials :16 00:00:00.000, 4200ms should update the profile :16 00:00:04.300, 4700ms should pay with a saved card :16 00:00:09.100, 3500ms should log… :16 00:00:12.700, 1300ms :16 00:00:14.300, 0ms section worker-1 should register a new user :16 00:00:00.000, 6000ms should search by product name :16 00:00:06.100, 3400ms should filter by price :16 00:00:09.600, 2400ms should sort by rating :16 00:00:12.100, 2100ms section worker-2 should empty the cart :16 00:00:00.000, 2900ms should pay with a saved card (attempt 1) :active, 16 00:00:02.950, 4450ms should keep the cart after r… :16 00:00:07.500, 2900ms should apply a discount code :16 00:00:10.500, 3600ms section worker-3 should show the order history :16 00:00:00.000, 4900ms should sugge… :active, 16 00:00:05.000, 1500ms section worker-4 should sug… :16 00:00:06.700, 1300ms should export orders as CSV :16 00:00:08.100, 3700ms should send the receipt :16 00:00:11.900, 2400msHow to review
src/ctrf/timeline/collect.ts:readTestsreadsattempt.threadId, cleaned up like a test's.collectTimelinemarks attempts without one asinheritedThread.arrange()lays out everything that records its thread together, and passes only inherited attempts toplaceAttempts().src/ctrf/timeline/types.ts:TimelineExecution.inheritedThread.docs/report-showcase.md(the retries bullet) and the CHANGELOG under Unreleased.dist/is rebuilt, and differs frommain's build only by this change.Testing
__tests__/ctrf/timeline.test.ts("runs before a retry that record their thread"), each written first and seen failing. They cover:npm test: 358 passed.npm run build:checkand Biome are clean.ctrf0.6.0. The action self-test's timeline job renders it.