Repository: moby/moby
Pull request #49897: Refactor CPU stats collection
Author: login: onprema
Labels: name: status/2-code-review
name: kind/refactor
description: PR's that refactor, or clean-up code
Created: 2025-04-29T00:10:28Z | Merged: 2025-05-16T16:42:34Z

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/moby/moby/blob/master/CONTRIBUTING.md

** Make sure all your commits include a signature generated with `git commit -s` **

For additional information on our contributing process, read our contributing
guide https://docs.docker.com/opensource/code/

If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"

Please provide the following information:
-->

Fixes #49768 

**- What I did**
Implemented the refactor suggestions by @vvoland mentioned in #49768 

**- How I did it**
- Ran the docker dev container
- Ran the unit tests for the `daemon/` directory (`TESTDIRS='./daemon' hack/test/unit`) and verified all tests were passing
- Refactored the code by creating an additional function and removing a testdata file
- Updated the unit test
- Ran the unit tests again to make sure everything still passed

**- How to verify it**
- Create docker dev container
- Run the daemon unit tests: `TESTDIRS='./daemon' hack/test/unit`
- Build the binary: `hack/make.sh binary && make install`
- Run dockerd: `dockerd -D &`
- Run `docker stats`

**- Human readable description for the release notes**
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog.
It must be placed inside the below triple backticks section.

NOTE: Only fill this section if changes introduced in this PR are user-facing.
The PR must have a relevant impact/ label.
-->
```markdown changelog
```

**- A picture of a cute animal (not mandatory but encouraged)**
![babygorilla](https://github.com/user-attachments/assets/bdf68bb0-cde1-4a81-9484-a45ba8c81615)




Linked issue #49768: `docker stats` follow-up
Address comments from https://github.com/moby/moby/pull/49734#pullrequestreview-2746148055
            
Linked issue comments: user: login: onprema
created_at: 2025-04-28T00:55:03Z
body: I'd like to take a shot at this.
author_association: CONTRIBUTOR
user: login: vvoland
created_at: 2025-04-28T08:50:46Z
body: Thanks! Feel free to open a PR
author_association: CONTRIBUTOR

Diff:
diff --git a/daemon/stats_unix.go b/daemon/stats_unix.go
index f734f66b9e6cc..ed8ac35439c42 100644
--- a/daemon/stats_unix.go
+++ b/daemon/stats_unix.go
@@ -6,6 +6,7 @@ import (
 	"bufio"
 	"context"
 	"fmt"
+	"io"
 	"os"
 	"strconv"
 	"strings"
@@ -311,30 +312,29 @@ const (
 	nanoSecondsPerSecond = 1e9
 )
 
-var procStatPath = "/proc/stat"
-
-// getSystemCPUUsage returns the host system's cpu usage in
-// nanoseconds and number of online CPUs. An error is returned
-// if the format of the underlying file does not match.
-//
-// Uses /proc/stat defined by POSIX. Looks for the cpu
-// statistics line and then sums up the first seven fields
-// provided. See `man 5 proc` for details on specific field
-// information.
+// getSystemCPUUsage reads the system's CPU usage from /proc/stat and returns
+// the total CPU usage in nanoseconds and the number of CPUs.
 func getSystemCPUUsage() (cpuUsage uint64, cpuNum uint32, _ error) {
-	f, err := os.Open(procStatPath)
+	f, err := os.Open("/proc/stat")
 	if err != nil {
 		return 0, 0, err
 	}
 	defer f.Close()
 
-	rdr := bufio.NewReaderSize(f, 1024)
+	return readSystemCPUUsage(f)
+}
+
+// readSystemCPUUsage parses CPU usage information from a reader providing
+// /proc/stat format data. It returns the total CPU usage in nanoseconds
+// and the number of CPUs.
+func readSystemCPUUsage(r io.Reader) (cpuUsage uint64, cpuNum uint32, _ error) {
+	rdr := bufio.NewReaderSize(r, 1024)
 
 	for {
 		data, isPartial, err := rdr.ReadLine()
 
 		if err != nil {
-			return 0, 0, fmt.Errorf("error scanning '%s' file: %w", procStatPath, err)
+			return 0, 0, fmt.Errorf("error scanning /proc/stat file: %w", err)
 		}
 		// Assume all cpu* records are at the start of the file, like glibc:
 		// https://github.com/bminor/glibc/blob/5d00c201b9a2da768a79ea8d5311f257871c0b43/sysdeps/unix/sysv/linux/getsysstats.c#L108-L135
@@ -358,8 +358,7 @@ func getSystemCPUUsage() (cpuUsage uint64, cpuNum uint32, _ error) {
 				}
 				totalClockTicks += v
 			}
-			cpuUsage = (totalClockTicks * nanoSecondsPerSecond) /
-				clockTicksPerSecond
+			cpuUsage = (totalClockTicks * nanoSecondsPerSecond) / clockTicksPerSecond
 		}
 		if '0' <= line[3] && line[3] <= '9' {
 			cpuNum++
diff --git a/daemon/stats_unix_test.go b/daemon/stats_unix_test.go
index 847e1a1e4adb5..277e68d4f6e7d 100644
--- a/daemon/stats_unix_test.go
+++ b/daemon/stats_unix_test.go
@@ -3,28 +3,20 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	_ "embed"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
-func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
-
-	_, err := os.Stat(dummyFilePath)
-	assert.NilError(t, err)
+//go:embed testdata/stat
+var statData string
 
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
-	assert.NilError(t, err)
+func TestGetSystemCPUUsageParsing(t *testing.T) {
+	input := strings.NewReader(statData)
+	cpuUsage, cpuNum, _ := readSystemCPUUsage(input)
+	assert.Check(t, is.Equal(cpuUsage, uint64(65647090000000)))
+	assert.Check(t, is.Equal(cpuNum, uint32(128)))
 }


Reviews:
user: login: vvoland
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T11:22:32Z
user: login: onprema
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T20:44:38Z
user: login: vvoland
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-14T06:59:04Z
user: login: onprema
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:06:57Z
user: login: vvoland
body: Thanks! Left one more nit, also please [squash your commits](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#commit-messages) ❤️ 
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:44:23Z
user: login: vvoland
body: LGTM, thanks!
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T16:16:14Z

Review comments:
diff_hunk: @@ -3,28 +3,154 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
 func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
-
-	_, err := os.Stat(dummyFilePath)
-	assert.NilError(t, err)
-
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
+	// Inline /proc/stat data example
+	input := strings.NewReader(`cpu  898 2 3273 6560407 67 0 62 0 0 0
+cpu0 2 0 210 49980 0 0 2 0 0 0
+cpu1 11 0 68 51210 1 0 1 0 0 0
+cpu2 14 0 31 51244 3 0 1 0 0 0
+cpu3 4 0 8 51291 0 0 1 0 0 0
+cpu4 9 0 44 51245 0 0 1 0 0 0
+cpu5 9 0 41 51218 0 0 1 0 0 0
+cpu6 1 0 12 51286 0 0 1 0 0 0
+cpu7 6 0 5 51289 0 0 1 0 0 0
+cpu8 5 0 133 51148 0 0 1 0 0 0
+cpu9 2 0 26 51275 1 0 1 0 0 0
+cpu10 4 0 601 50526 0 0 1 0 0 0
+cpu11 7 0 277 50921 0 0 1 0 0 0
+cpu12 1 0 10 51289 0 0 1 0 0 0
+cpu13 8 0 11 51282 1 0 1 0 0 0
+cpu14 6 0 12 51282 0 0 1 0 0 0
+cpu15 10 0 20 51277 0 0 1 0 0 0
+cpu16 2 0 10 51291 0 0 1 0 0 0
+cpu17 9 0 17 51277 0 0 1 0 0 0
+cpu18 3 0 9 51288 0 0 1 0 0 0
+cpu19 3 0 15 51288 0 0 1 0 0 0
+cpu20 70 0 27 51199 6 0 1 0 0 0
+cpu21 19 0 15 51184 3 0 6 0 0 0
+cpu22 11 2 19 51249 2 0 1 0 0 0
+cpu23 4 0 11 51289 0 0 1 0 0 0
+cpu24 7 0 16 51280 0 0 2 0 0 0
+cpu25 7 0 9 51284 0 0 1 0 0 0
+cpu26 6 0 11 51289 0 0 1 0 0 0
+cpu27 0 0 22 51278 0 0 1 0 0 0
+cpu28 5 0 14 51269 0 0 1 0 0 0
+cpu29 15 0 15 51270 0 0 1 0 0 0
+cpu30 6 0 19 51273 2 0 1 0 0 0
+cpu31 2 0 24 51265 6 0 1 0 0 0
+cpu32 4 0 10 51290 0 0 1 0 0 0
+cpu33 3 0 12 51281 1 0 1 0 0 0
+cpu34 3 0 8 51295 0 0 1 0 0 0
+cpu35 4 0 11 51276 0 0 1 0 0 0
+cpu36 7 0 8 51280 1 0 1 0 0 0
+cpu37 5 0 8 51289 0 0 1 0 0 0
+cpu38 3 0 12 51283 1 0 1 0 0 0
+cpu39 9 0 22 51274 0 0 1 0 0 0
+cpu40 7 0 17 51255 0 0 1 0 0 0
+cpu41 7 0 44 51238 0 0 1 0 0 0
+cpu42 1 0 8 51288 0 0 1 0 0 0
+cpu43 10 0 16 51268 3 0 1 0 0 0
+cpu44 7 0 12 51260 0 0 1 0 0 0
+cpu45 28 0 20 51253 0 0 1 0 0 0
+cpu46 8 0 7 51284 1 0 1 0 0 0
+cpu47 7 0 11 51286 0 0 1 0 0 0
+cpu48 2 0 16 51290 0 0 1 0 0 0
+cpu49 2 0 15 51284 1 0 1 0 0 0
+cpu50 8 0 13 51284 0 0 1 0 0 0
+cpu51 5 0 12 51280 2 0 1 0 0 0
+cpu52 8 0 13 51280 0 0 0 0 0 0
+cpu53 15 0 20 51262 0 0 1 0 0 0
+cpu54 4 0 12 51286 0 0 1 0 0 0
+cpu55 9 0 14 51275 2 0 1 0 0 0
+cpu56 5 0 17 51274 0 0 0 0 0 0
+cpu57 5 0 15 51278 1 0 0 0 0 0
+cpu58 6 0 16 51279 0 0 0 0 0 0
+cpu59 11 0 15 51267 0 0 0 0 0 0
+cpu60 5 0 6 51283 0 0 0 0 0 0
+cpu61 4 0 15 51275 0 0 0 0 0 0
+cpu62 7 0 11 51285 0 0 0 0 0 0
+cpu63 8 0 18 51280 0 0 0 0 0 0
+cpu64 10 0 24 51245 1 0 0 0 0 0
+cpu65 11 0 41 51189 1 0 0 0 0 0
+cpu66 16 0 25 51263 0 0 0 0 0 0
+cpu67 16 0 30 51251 0 0 0 0 0 0
+cpu68 5 0 10 51284 0 0 0 0 0 0
+cpu69 9 0 24 51270 2 0 0 0 0 0
+cpu70 6 0 15 51285 0 0 0 0 0 0
+cpu71 6 0 11 51283 0 0 0 0 0 0
+cpu72 11 0 16 51280 0 0 0 0 0 0
+cpu73 16 0 11 51274 0 0 0 0 0 0
+cpu74 7 0 10 51283 0 0 0 0 0 0
+cpu75 9 0 21 51266 0 0 0 0 0 0
+cpu76 4 0 7 51284 0 0 0 0 0 0
+cpu77 7 0 17 51275 0 0 0 0 0 0
+cpu78 3 0 11 51289 0 0 0 0 0 0
+cpu79 5 0 24 51273 0 0 0 0 0 0
+cpu80 0 0 16 51286 0 0 0 0 0 0
+cpu81 12 0 23 51268 0 0 0 0 0 0
+cpu82 4 0 125 51171 0 0 0 0 0 0
+cpu83 1 0 21 51278 0 0 0 0 0 0
+cpu84 6 0 14 51271 0 0 0 0 0 0
+cpu85 26 0 21 51256 0 0 0 0 0 0
+cpu86 9 0 7 51273 0 0 0 0 0 0
+cpu87 6 0 22 51274 0 0 0 0 0 0
+cpu88 4 0 4 51287 0 0 0 0 0 0
+cpu89 9 0 13 51275 0 0 0 0 0 0
+cpu90 20 0 26 51105 0 0 0 0 0 0
+cpu91 6 0 15 51275 0 0 0 0 0 0
+cpu92 3 0 12 51284 0 0 0 0 0 0
+cpu93 7 0 15 51267 0 0 0 0 0 0
+cpu94 10 0 12 51278 0 0 0 0 0 0
+cpu95 7 0 17 51279 0 0 0 0 0 0
+cpu96 1 0 13 51287 0 0 0 0 0 0
+cpu97 5 0 18 51277 0 0 0 0 0 0
+cpu98 2 0 7 51288 0 0 0 0 0 0
+cpu99 11 0 21 51260 0 0 0 0 0 0
+cpu100 2 0 13 51286 0 0 0 0 0 0
+cpu101 5 0 20 51275 0 0 0 0 0 0
+cpu102 0 0 13 51288 0 0 0 0 0 0
+cpu103 4 0 10 51283 0 0 0 0 0 0
+cpu104 3 0 15 51284 0 0 0 0 0 0
+cpu105 7 0 13 51283 0 0 0 0 0 0
+cpu106 1 0 12 51286 0 0 0 0 0 0
+cpu107 4 0 18 51278 0 0 0 0 0 0
+cpu108 9 0 7 51283 0 0 0 0 0 0
+cpu109 7 0 9 51281 0 0 0 0 0 0
+cpu110 8 0 9 51279 0 0 0 0 0 0
+cpu111 3 0 21 51278 0 0 0 0 0 0
+cpu112 9 0 10 51275 0 0 0 0 0 0
+cpu113 3 0 10 51287 0 0 0 0 0 0
+cpu114 5 0 11 51285 0 0 0 0 0 0
+cpu115 2 0 13 51284 0 0 0 0 0 0
+cpu116 9 0 11 51280 0 0 0 0 0 0
+cpu117 5 0 11 51285 0 0 0 0 0 0
+cpu118 4 0 12 51287 0 0 0 0 0 0
+cpu119 3 0 10 51285 0 0 0 0 0 0
+cpu120 5 0 13 51280 0 0 0 0 0 0
+cpu121 3 0 12 51288 0 0 0 0 0 0
+cpu122 3 0 7 51286 0 0 0 0 0 0
+cpu123 2 0 16 51281 0 0 0 0 0 0
+cpu124 2 0 8 51289 0 0 0 0 0 0
+cpu125 9 0 12 51274 0 0 0 0 0 0
+cpu126 3 0 8 51281 0 0 0 0 0 0
+cpu127 3 0 14 51286 0 0 0 0 0 0
+intr [ ... snipped for brevity ... ]
path: daemon/stats_unix_test.go
user: login: vvoland
body: The `intr` part was actually crucial here since the original change fixed a bug where too long line would make the function error out.

But yeah it might actually be too long for inlining...
So looks like we need to keep it in a separate file - although I'd be more happy to access it via `go:embed` instead of opening it at runtime.
This way the test is self-contained and verified at compile-time.
created_at: 2025-05-13T11:22:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3,28 +3,154 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
 func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
-
-	_, err := os.Stat(dummyFilePath)
-	assert.NilError(t, err)
-
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
+	// Inline /proc/stat data example
+	input := strings.NewReader(`cpu  898 2 3273 6560407 67 0 62 0 0 0
+cpu0 2 0 210 49980 0 0 2 0 0 0
+cpu1 11 0 68 51210 1 0 1 0 0 0
+cpu2 14 0 31 51244 3 0 1 0 0 0
+cpu3 4 0 8 51291 0 0 1 0 0 0
+cpu4 9 0 44 51245 0 0 1 0 0 0
+cpu5 9 0 41 51218 0 0 1 0 0 0
+cpu6 1 0 12 51286 0 0 1 0 0 0
+cpu7 6 0 5 51289 0 0 1 0 0 0
+cpu8 5 0 133 51148 0 0 1 0 0 0
+cpu9 2 0 26 51275 1 0 1 0 0 0
+cpu10 4 0 601 50526 0 0 1 0 0 0
+cpu11 7 0 277 50921 0 0 1 0 0 0
+cpu12 1 0 10 51289 0 0 1 0 0 0
+cpu13 8 0 11 51282 1 0 1 0 0 0
+cpu14 6 0 12 51282 0 0 1 0 0 0
+cpu15 10 0 20 51277 0 0 1 0 0 0
+cpu16 2 0 10 51291 0 0 1 0 0 0
+cpu17 9 0 17 51277 0 0 1 0 0 0
+cpu18 3 0 9 51288 0 0 1 0 0 0
+cpu19 3 0 15 51288 0 0 1 0 0 0
+cpu20 70 0 27 51199 6 0 1 0 0 0
+cpu21 19 0 15 51184 3 0 6 0 0 0
+cpu22 11 2 19 51249 2 0 1 0 0 0
+cpu23 4 0 11 51289 0 0 1 0 0 0
+cpu24 7 0 16 51280 0 0 2 0 0 0
+cpu25 7 0 9 51284 0 0 1 0 0 0
+cpu26 6 0 11 51289 0 0 1 0 0 0
+cpu27 0 0 22 51278 0 0 1 0 0 0
+cpu28 5 0 14 51269 0 0 1 0 0 0
+cpu29 15 0 15 51270 0 0 1 0 0 0
+cpu30 6 0 19 51273 2 0 1 0 0 0
+cpu31 2 0 24 51265 6 0 1 0 0 0
+cpu32 4 0 10 51290 0 0 1 0 0 0
+cpu33 3 0 12 51281 1 0 1 0 0 0
+cpu34 3 0 8 51295 0 0 1 0 0 0
+cpu35 4 0 11 51276 0 0 1 0 0 0
+cpu36 7 0 8 51280 1 0 1 0 0 0
+cpu37 5 0 8 51289 0 0 1 0 0 0
+cpu38 3 0 12 51283 1 0 1 0 0 0
+cpu39 9 0 22 51274 0 0 1 0 0 0
+cpu40 7 0 17 51255 0 0 1 0 0 0
+cpu41 7 0 44 51238 0 0 1 0 0 0
+cpu42 1 0 8 51288 0 0 1 0 0 0
+cpu43 10 0 16 51268 3 0 1 0 0 0
+cpu44 7 0 12 51260 0 0 1 0 0 0
+cpu45 28 0 20 51253 0 0 1 0 0 0
+cpu46 8 0 7 51284 1 0 1 0 0 0
+cpu47 7 0 11 51286 0 0 1 0 0 0
+cpu48 2 0 16 51290 0 0 1 0 0 0
+cpu49 2 0 15 51284 1 0 1 0 0 0
+cpu50 8 0 13 51284 0 0 1 0 0 0
+cpu51 5 0 12 51280 2 0 1 0 0 0
+cpu52 8 0 13 51280 0 0 0 0 0 0
+cpu53 15 0 20 51262 0 0 1 0 0 0
+cpu54 4 0 12 51286 0 0 1 0 0 0
+cpu55 9 0 14 51275 2 0 1 0 0 0
+cpu56 5 0 17 51274 0 0 0 0 0 0
+cpu57 5 0 15 51278 1 0 0 0 0 0
+cpu58 6 0 16 51279 0 0 0 0 0 0
+cpu59 11 0 15 51267 0 0 0 0 0 0
+cpu60 5 0 6 51283 0 0 0 0 0 0
+cpu61 4 0 15 51275 0 0 0 0 0 0
+cpu62 7 0 11 51285 0 0 0 0 0 0
+cpu63 8 0 18 51280 0 0 0 0 0 0
+cpu64 10 0 24 51245 1 0 0 0 0 0
+cpu65 11 0 41 51189 1 0 0 0 0 0
+cpu66 16 0 25 51263 0 0 0 0 0 0
+cpu67 16 0 30 51251 0 0 0 0 0 0
+cpu68 5 0 10 51284 0 0 0 0 0 0
+cpu69 9 0 24 51270 2 0 0 0 0 0
+cpu70 6 0 15 51285 0 0 0 0 0 0
+cpu71 6 0 11 51283 0 0 0 0 0 0
+cpu72 11 0 16 51280 0 0 0 0 0 0
+cpu73 16 0 11 51274 0 0 0 0 0 0
+cpu74 7 0 10 51283 0 0 0 0 0 0
+cpu75 9 0 21 51266 0 0 0 0 0 0
+cpu76 4 0 7 51284 0 0 0 0 0 0
+cpu77 7 0 17 51275 0 0 0 0 0 0
+cpu78 3 0 11 51289 0 0 0 0 0 0
+cpu79 5 0 24 51273 0 0 0 0 0 0
+cpu80 0 0 16 51286 0 0 0 0 0 0
+cpu81 12 0 23 51268 0 0 0 0 0 0
+cpu82 4 0 125 51171 0 0 0 0 0 0
+cpu83 1 0 21 51278 0 0 0 0 0 0
+cpu84 6 0 14 51271 0 0 0 0 0 0
+cpu85 26 0 21 51256 0 0 0 0 0 0
+cpu86 9 0 7 51273 0 0 0 0 0 0
+cpu87 6 0 22 51274 0 0 0 0 0 0
+cpu88 4 0 4 51287 0 0 0 0 0 0
+cpu89 9 0 13 51275 0 0 0 0 0 0
+cpu90 20 0 26 51105 0 0 0 0 0 0
+cpu91 6 0 15 51275 0 0 0 0 0 0
+cpu92 3 0 12 51284 0 0 0 0 0 0
+cpu93 7 0 15 51267 0 0 0 0 0 0
+cpu94 10 0 12 51278 0 0 0 0 0 0
+cpu95 7 0 17 51279 0 0 0 0 0 0
+cpu96 1 0 13 51287 0 0 0 0 0 0
+cpu97 5 0 18 51277 0 0 0 0 0 0
+cpu98 2 0 7 51288 0 0 0 0 0 0
+cpu99 11 0 21 51260 0 0 0 0 0 0
+cpu100 2 0 13 51286 0 0 0 0 0 0
+cpu101 5 0 20 51275 0 0 0 0 0 0
+cpu102 0 0 13 51288 0 0 0 0 0 0
+cpu103 4 0 10 51283 0 0 0 0 0 0
+cpu104 3 0 15 51284 0 0 0 0 0 0
+cpu105 7 0 13 51283 0 0 0 0 0 0
+cpu106 1 0 12 51286 0 0 0 0 0 0
+cpu107 4 0 18 51278 0 0 0 0 0 0
+cpu108 9 0 7 51283 0 0 0 0 0 0
+cpu109 7 0 9 51281 0 0 0 0 0 0
+cpu110 8 0 9 51279 0 0 0 0 0 0
+cpu111 3 0 21 51278 0 0 0 0 0 0
+cpu112 9 0 10 51275 0 0 0 0 0 0
+cpu113 3 0 10 51287 0 0 0 0 0 0
+cpu114 5 0 11 51285 0 0 0 0 0 0
+cpu115 2 0 13 51284 0 0 0 0 0 0
+cpu116 9 0 11 51280 0 0 0 0 0 0
+cpu117 5 0 11 51285 0 0 0 0 0 0
+cpu118 4 0 12 51287 0 0 0 0 0 0
+cpu119 3 0 10 51285 0 0 0 0 0 0
+cpu120 5 0 13 51280 0 0 0 0 0 0
+cpu121 3 0 12 51288 0 0 0 0 0 0
+cpu122 3 0 7 51286 0 0 0 0 0 0
+cpu123 2 0 16 51281 0 0 0 0 0 0
+cpu124 2 0 8 51289 0 0 0 0 0 0
+cpu125 9 0 12 51274 0 0 0 0 0 0
+cpu126 3 0 8 51281 0 0 0 0 0 0
+cpu127 3 0 14 51286 0 0 0 0 0 0
+intr [ ... snipped for brevity ... ]
path: daemon/stats_unix_test.go
user: login: onprema
body: >But yeah it might actually be too long for inlining...

I don't think its too long, actually. I just wasn't aware that the entire line was crucial.

I just restored the original /proc/stat output, and the tests are still passing.
created_at: 2025-05-13T20:44:38Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3,28 +3,154 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
 func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
-
-	_, err := os.Stat(dummyFilePath)
-	assert.NilError(t, err)
-
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
+	// Inline /proc/stat data example
+	input := strings.NewReader(`cpu  898 2 3273 6560407 67 0 62 0 0 0
+cpu0 2 0 210 49980 0 0 2 0 0 0
+cpu1 11 0 68 51210 1 0 1 0 0 0
+cpu2 14 0 31 51244 3 0 1 0 0 0
+cpu3 4 0 8 51291 0 0 1 0 0 0
+cpu4 9 0 44 51245 0 0 1 0 0 0
+cpu5 9 0 41 51218 0 0 1 0 0 0
+cpu6 1 0 12 51286 0 0 1 0 0 0
+cpu7 6 0 5 51289 0 0 1 0 0 0
+cpu8 5 0 133 51148 0 0 1 0 0 0
+cpu9 2 0 26 51275 1 0 1 0 0 0
+cpu10 4 0 601 50526 0 0 1 0 0 0
+cpu11 7 0 277 50921 0 0 1 0 0 0
+cpu12 1 0 10 51289 0 0 1 0 0 0
+cpu13 8 0 11 51282 1 0 1 0 0 0
+cpu14 6 0 12 51282 0 0 1 0 0 0
+cpu15 10 0 20 51277 0 0 1 0 0 0
+cpu16 2 0 10 51291 0 0 1 0 0 0
+cpu17 9 0 17 51277 0 0 1 0 0 0
+cpu18 3 0 9 51288 0 0 1 0 0 0
+cpu19 3 0 15 51288 0 0 1 0 0 0
+cpu20 70 0 27 51199 6 0 1 0 0 0
+cpu21 19 0 15 51184 3 0 6 0 0 0
+cpu22 11 2 19 51249 2 0 1 0 0 0
+cpu23 4 0 11 51289 0 0 1 0 0 0
+cpu24 7 0 16 51280 0 0 2 0 0 0
+cpu25 7 0 9 51284 0 0 1 0 0 0
+cpu26 6 0 11 51289 0 0 1 0 0 0
+cpu27 0 0 22 51278 0 0 1 0 0 0
+cpu28 5 0 14 51269 0 0 1 0 0 0
+cpu29 15 0 15 51270 0 0 1 0 0 0
+cpu30 6 0 19 51273 2 0 1 0 0 0
+cpu31 2 0 24 51265 6 0 1 0 0 0
+cpu32 4 0 10 51290 0 0 1 0 0 0
+cpu33 3 0 12 51281 1 0 1 0 0 0
+cpu34 3 0 8 51295 0 0 1 0 0 0
+cpu35 4 0 11 51276 0 0 1 0 0 0
+cpu36 7 0 8 51280 1 0 1 0 0 0
+cpu37 5 0 8 51289 0 0 1 0 0 0
+cpu38 3 0 12 51283 1 0 1 0 0 0
+cpu39 9 0 22 51274 0 0 1 0 0 0
+cpu40 7 0 17 51255 0 0 1 0 0 0
+cpu41 7 0 44 51238 0 0 1 0 0 0
+cpu42 1 0 8 51288 0 0 1 0 0 0
+cpu43 10 0 16 51268 3 0 1 0 0 0
+cpu44 7 0 12 51260 0 0 1 0 0 0
+cpu45 28 0 20 51253 0 0 1 0 0 0
+cpu46 8 0 7 51284 1 0 1 0 0 0
+cpu47 7 0 11 51286 0 0 1 0 0 0
+cpu48 2 0 16 51290 0 0 1 0 0 0
+cpu49 2 0 15 51284 1 0 1 0 0 0
+cpu50 8 0 13 51284 0 0 1 0 0 0
+cpu51 5 0 12 51280 2 0 1 0 0 0
+cpu52 8 0 13 51280 0 0 0 0 0 0
+cpu53 15 0 20 51262 0 0 1 0 0 0
+cpu54 4 0 12 51286 0 0 1 0 0 0
+cpu55 9 0 14 51275 2 0 1 0 0 0
+cpu56 5 0 17 51274 0 0 0 0 0 0
+cpu57 5 0 15 51278 1 0 0 0 0 0
+cpu58 6 0 16 51279 0 0 0 0 0 0
+cpu59 11 0 15 51267 0 0 0 0 0 0
+cpu60 5 0 6 51283 0 0 0 0 0 0
+cpu61 4 0 15 51275 0 0 0 0 0 0
+cpu62 7 0 11 51285 0 0 0 0 0 0
+cpu63 8 0 18 51280 0 0 0 0 0 0
+cpu64 10 0 24 51245 1 0 0 0 0 0
+cpu65 11 0 41 51189 1 0 0 0 0 0
+cpu66 16 0 25 51263 0 0 0 0 0 0
+cpu67 16 0 30 51251 0 0 0 0 0 0
+cpu68 5 0 10 51284 0 0 0 0 0 0
+cpu69 9 0 24 51270 2 0 0 0 0 0
+cpu70 6 0 15 51285 0 0 0 0 0 0
+cpu71 6 0 11 51283 0 0 0 0 0 0
+cpu72 11 0 16 51280 0 0 0 0 0 0
+cpu73 16 0 11 51274 0 0 0 0 0 0
+cpu74 7 0 10 51283 0 0 0 0 0 0
+cpu75 9 0 21 51266 0 0 0 0 0 0
+cpu76 4 0 7 51284 0 0 0 0 0 0
+cpu77 7 0 17 51275 0 0 0 0 0 0
+cpu78 3 0 11 51289 0 0 0 0 0 0
+cpu79 5 0 24 51273 0 0 0 0 0 0
+cpu80 0 0 16 51286 0 0 0 0 0 0
+cpu81 12 0 23 51268 0 0 0 0 0 0
+cpu82 4 0 125 51171 0 0 0 0 0 0
+cpu83 1 0 21 51278 0 0 0 0 0 0
+cpu84 6 0 14 51271 0 0 0 0 0 0
+cpu85 26 0 21 51256 0 0 0 0 0 0
+cpu86 9 0 7 51273 0 0 0 0 0 0
+cpu87 6 0 22 51274 0 0 0 0 0 0
+cpu88 4 0 4 51287 0 0 0 0 0 0
+cpu89 9 0 13 51275 0 0 0 0 0 0
+cpu90 20 0 26 51105 0 0 0 0 0 0
+cpu91 6 0 15 51275 0 0 0 0 0 0
+cpu92 3 0 12 51284 0 0 0 0 0 0
+cpu93 7 0 15 51267 0 0 0 0 0 0
+cpu94 10 0 12 51278 0 0 0 0 0 0
+cpu95 7 0 17 51279 0 0 0 0 0 0
+cpu96 1 0 13 51287 0 0 0 0 0 0
+cpu97 5 0 18 51277 0 0 0 0 0 0
+cpu98 2 0 7 51288 0 0 0 0 0 0
+cpu99 11 0 21 51260 0 0 0 0 0 0
+cpu100 2 0 13 51286 0 0 0 0 0 0
+cpu101 5 0 20 51275 0 0 0 0 0 0
+cpu102 0 0 13 51288 0 0 0 0 0 0
+cpu103 4 0 10 51283 0 0 0 0 0 0
+cpu104 3 0 15 51284 0 0 0 0 0 0
+cpu105 7 0 13 51283 0 0 0 0 0 0
+cpu106 1 0 12 51286 0 0 0 0 0 0
+cpu107 4 0 18 51278 0 0 0 0 0 0
+cpu108 9 0 7 51283 0 0 0 0 0 0
+cpu109 7 0 9 51281 0 0 0 0 0 0
+cpu110 8 0 9 51279 0 0 0 0 0 0
+cpu111 3 0 21 51278 0 0 0 0 0 0
+cpu112 9 0 10 51275 0 0 0 0 0 0
+cpu113 3 0 10 51287 0 0 0 0 0 0
+cpu114 5 0 11 51285 0 0 0 0 0 0
+cpu115 2 0 13 51284 0 0 0 0 0 0
+cpu116 9 0 11 51280 0 0 0 0 0 0
+cpu117 5 0 11 51285 0 0 0 0 0 0
+cpu118 4 0 12 51287 0 0 0 0 0 0
+cpu119 3 0 10 51285 0 0 0 0 0 0
+cpu120 5 0 13 51280 0 0 0 0 0 0
+cpu121 3 0 12 51288 0 0 0 0 0 0
+cpu122 3 0 7 51286 0 0 0 0 0 0
+cpu123 2 0 16 51281 0 0 0 0 0 0
+cpu124 2 0 8 51289 0 0 0 0 0 0
+cpu125 9 0 12 51274 0 0 0 0 0 0
+cpu126 3 0 8 51281 0 0 0 0 0 0
+cpu127 3 0 14 51286 0 0 0 0 0 0
+intr [ ... snipped for brevity ... ]
path: daemon/stats_unix_test.go
user: login: vvoland
body: > I don't think its too long

Technically there's nothing wrong, but it makes reviewing awkward 🙈 

<img width="739" alt="image" src="https://github.com/user-attachments/assets/ed4a8c03-512e-4b45-8d3d-43f29f33d079" />


created_at: 2025-05-14T06:59:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3,28 +3,154 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
 func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
-
-	_, err := os.Stat(dummyFilePath)
-	assert.NilError(t, err)
-
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
+	// Inline /proc/stat data example
+	input := strings.NewReader(`cpu  898 2 3273 6560407 67 0 62 0 0 0
+cpu0 2 0 210 49980 0 0 2 0 0 0
+cpu1 11 0 68 51210 1 0 1 0 0 0
+cpu2 14 0 31 51244 3 0 1 0 0 0
+cpu3 4 0 8 51291 0 0 1 0 0 0
+cpu4 9 0 44 51245 0 0 1 0 0 0
+cpu5 9 0 41 51218 0 0 1 0 0 0
+cpu6 1 0 12 51286 0 0 1 0 0 0
+cpu7 6 0 5 51289 0 0 1 0 0 0
+cpu8 5 0 133 51148 0 0 1 0 0 0
+cpu9 2 0 26 51275 1 0 1 0 0 0
+cpu10 4 0 601 50526 0 0 1 0 0 0
+cpu11 7 0 277 50921 0 0 1 0 0 0
+cpu12 1 0 10 51289 0 0 1 0 0 0
+cpu13 8 0 11 51282 1 0 1 0 0 0
+cpu14 6 0 12 51282 0 0 1 0 0 0
+cpu15 10 0 20 51277 0 0 1 0 0 0
+cpu16 2 0 10 51291 0 0 1 0 0 0
+cpu17 9 0 17 51277 0 0 1 0 0 0
+cpu18 3 0 9 51288 0 0 1 0 0 0
+cpu19 3 0 15 51288 0 0 1 0 0 0
+cpu20 70 0 27 51199 6 0 1 0 0 0
+cpu21 19 0 15 51184 3 0 6 0 0 0
+cpu22 11 2 19 51249 2 0 1 0 0 0
+cpu23 4 0 11 51289 0 0 1 0 0 0
+cpu24 7 0 16 51280 0 0 2 0 0 0
+cpu25 7 0 9 51284 0 0 1 0 0 0
+cpu26 6 0 11 51289 0 0 1 0 0 0
+cpu27 0 0 22 51278 0 0 1 0 0 0
+cpu28 5 0 14 51269 0 0 1 0 0 0
+cpu29 15 0 15 51270 0 0 1 0 0 0
+cpu30 6 0 19 51273 2 0 1 0 0 0
+cpu31 2 0 24 51265 6 0 1 0 0 0
+cpu32 4 0 10 51290 0 0 1 0 0 0
+cpu33 3 0 12 51281 1 0 1 0 0 0
+cpu34 3 0 8 51295 0 0 1 0 0 0
+cpu35 4 0 11 51276 0 0 1 0 0 0
+cpu36 7 0 8 51280 1 0 1 0 0 0
+cpu37 5 0 8 51289 0 0 1 0 0 0
+cpu38 3 0 12 51283 1 0 1 0 0 0
+cpu39 9 0 22 51274 0 0 1 0 0 0
+cpu40 7 0 17 51255 0 0 1 0 0 0
+cpu41 7 0 44 51238 0 0 1 0 0 0
+cpu42 1 0 8 51288 0 0 1 0 0 0
+cpu43 10 0 16 51268 3 0 1 0 0 0
+cpu44 7 0 12 51260 0 0 1 0 0 0
+cpu45 28 0 20 51253 0 0 1 0 0 0
+cpu46 8 0 7 51284 1 0 1 0 0 0
+cpu47 7 0 11 51286 0 0 1 0 0 0
+cpu48 2 0 16 51290 0 0 1 0 0 0
+cpu49 2 0 15 51284 1 0 1 0 0 0
+cpu50 8 0 13 51284 0 0 1 0 0 0
+cpu51 5 0 12 51280 2 0 1 0 0 0
+cpu52 8 0 13 51280 0 0 0 0 0 0
+cpu53 15 0 20 51262 0 0 1 0 0 0
+cpu54 4 0 12 51286 0 0 1 0 0 0
+cpu55 9 0 14 51275 2 0 1 0 0 0
+cpu56 5 0 17 51274 0 0 0 0 0 0
+cpu57 5 0 15 51278 1 0 0 0 0 0
+cpu58 6 0 16 51279 0 0 0 0 0 0
+cpu59 11 0 15 51267 0 0 0 0 0 0
+cpu60 5 0 6 51283 0 0 0 0 0 0
+cpu61 4 0 15 51275 0 0 0 0 0 0
+cpu62 7 0 11 51285 0 0 0 0 0 0
+cpu63 8 0 18 51280 0 0 0 0 0 0
+cpu64 10 0 24 51245 1 0 0 0 0 0
+cpu65 11 0 41 51189 1 0 0 0 0 0
+cpu66 16 0 25 51263 0 0 0 0 0 0
+cpu67 16 0 30 51251 0 0 0 0 0 0
+cpu68 5 0 10 51284 0 0 0 0 0 0
+cpu69 9 0 24 51270 2 0 0 0 0 0
+cpu70 6 0 15 51285 0 0 0 0 0 0
+cpu71 6 0 11 51283 0 0 0 0 0 0
+cpu72 11 0 16 51280 0 0 0 0 0 0
+cpu73 16 0 11 51274 0 0 0 0 0 0
+cpu74 7 0 10 51283 0 0 0 0 0 0
+cpu75 9 0 21 51266 0 0 0 0 0 0
+cpu76 4 0 7 51284 0 0 0 0 0 0
+cpu77 7 0 17 51275 0 0 0 0 0 0
+cpu78 3 0 11 51289 0 0 0 0 0 0
+cpu79 5 0 24 51273 0 0 0 0 0 0
+cpu80 0 0 16 51286 0 0 0 0 0 0
+cpu81 12 0 23 51268 0 0 0 0 0 0
+cpu82 4 0 125 51171 0 0 0 0 0 0
+cpu83 1 0 21 51278 0 0 0 0 0 0
+cpu84 6 0 14 51271 0 0 0 0 0 0
+cpu85 26 0 21 51256 0 0 0 0 0 0
+cpu86 9 0 7 51273 0 0 0 0 0 0
+cpu87 6 0 22 51274 0 0 0 0 0 0
+cpu88 4 0 4 51287 0 0 0 0 0 0
+cpu89 9 0 13 51275 0 0 0 0 0 0
+cpu90 20 0 26 51105 0 0 0 0 0 0
+cpu91 6 0 15 51275 0 0 0 0 0 0
+cpu92 3 0 12 51284 0 0 0 0 0 0
+cpu93 7 0 15 51267 0 0 0 0 0 0
+cpu94 10 0 12 51278 0 0 0 0 0 0
+cpu95 7 0 17 51279 0 0 0 0 0 0
+cpu96 1 0 13 51287 0 0 0 0 0 0
+cpu97 5 0 18 51277 0 0 0 0 0 0
+cpu98 2 0 7 51288 0 0 0 0 0 0
+cpu99 11 0 21 51260 0 0 0 0 0 0
+cpu100 2 0 13 51286 0 0 0 0 0 0
+cpu101 5 0 20 51275 0 0 0 0 0 0
+cpu102 0 0 13 51288 0 0 0 0 0 0
+cpu103 4 0 10 51283 0 0 0 0 0 0
+cpu104 3 0 15 51284 0 0 0 0 0 0
+cpu105 7 0 13 51283 0 0 0 0 0 0
+cpu106 1 0 12 51286 0 0 0 0 0 0
+cpu107 4 0 18 51278 0 0 0 0 0 0
+cpu108 9 0 7 51283 0 0 0 0 0 0
+cpu109 7 0 9 51281 0 0 0 0 0 0
+cpu110 8 0 9 51279 0 0 0 0 0 0
+cpu111 3 0 21 51278 0 0 0 0 0 0
+cpu112 9 0 10 51275 0 0 0 0 0 0
+cpu113 3 0 10 51287 0 0 0 0 0 0
+cpu114 5 0 11 51285 0 0 0 0 0 0
+cpu115 2 0 13 51284 0 0 0 0 0 0
+cpu116 9 0 11 51280 0 0 0 0 0 0
+cpu117 5 0 11 51285 0 0 0 0 0 0
+cpu118 4 0 12 51287 0 0 0 0 0 0
+cpu119 3 0 10 51285 0 0 0 0 0 0
+cpu120 5 0 13 51280 0 0 0 0 0 0
+cpu121 3 0 12 51288 0 0 0 0 0 0
+cpu122 3 0 7 51286 0 0 0 0 0 0
+cpu123 2 0 16 51281 0 0 0 0 0 0
+cpu124 2 0 8 51289 0 0 0 0 0 0
+cpu125 9 0 12 51274 0 0 0 0 0 0
+cpu126 3 0 8 51281 0 0 0 0 0 0
+cpu127 3 0 14 51286 0 0 0 0 0 0
+intr [ ... snipped for brevity ... ]
path: daemon/stats_unix_test.go
user: login: onprema
body: Ah, yes. Ok, I've taken your suggested approach: restored `testdata/stat` and embedded the file contents so its not being read at runtime.
created_at: 2025-05-15T15:06:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3,28 +3,24 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"embed"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
-func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
+//go:embed testdata/stat
+var statData embed.FS
path: daemon/stats_unix_test.go
user: login: vvoland
body: You can read it directly to a string:
```suggestion
//go:embed testdata/stat
var statData string
```

created_at: 2025-05-16T10:43:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -3,28 +3,24 @@
 package daemon
 
 import (
-	"os"
-	"path/filepath"
+	"embed"
+	"strings"
 	"testing"
 
 	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 
-func TestGetSystemCPUUsageParsing(t *testing.T) {
-	dummyFilePath := filepath.Join("testdata", "stat")
-	expectedCpuUsage := uint64(65647090000000)
-	expectedCpuNum := uint32(128)
-
-	origStatPath := procStatPath
-	procStatPath = dummyFilePath
-	defer func() { procStatPath = origStatPath }()
+//go:embed testdata/stat
+var statData embed.FS
 
-	_, err := os.Stat(dummyFilePath)
+func TestGetSystemCPUUsageParsing(t *testing.T) {
+	// Read the embedded stat testfile
+	data, err := statData.ReadFile("testdata/stat")
 	assert.NilError(t, err)
 
-	cpuUsage, cpuNum, err := getSystemCPUUsage()
-
-	assert.Equal(t, cpuUsage, expectedCpuUsage)
-	assert.Equal(t, cpuNum, expectedCpuNum)
-	assert.NilError(t, err)
+	input := strings.NewReader(string(data))
path: daemon/stats_unix_test.go
user: login: vvoland
body: So all we need is:

```suggestion
	input := strings.NewReader(statData)
```
created_at: 2025-05-16T10:43:40Z
author_association: CONTRIBUTOR

PR comments:
user: login: onprema
created_at: 2025-05-05T01:21:40Z
body: @vvoland, just wanted to make sure you saw this. 
author_association: CONTRIBUTOR
user: login: onprema
created_at: 2025-05-16T16:04:18Z
body: > Thanks! Left one more nit, also please [squash your commits](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#commit-messages) ❤️

Thanks for your guidance, @vvoland -- I made the switch from `embed.FS` -> `string`, squashed my commits and improve my commit message. It looks like a couple of the tests are failing, but don't seem related to this change. Is this typical? Do you have any pointers on how I should proceed?
author_association: CONTRIBUTOR
user: login: vvoland
created_at: 2025-05-16T16:15:55Z
body: It's just flaky tests, I kicked the CI again to rerun these.
author_association: CONTRIBUTOR