Category
Error handling gaps
Description
internal/workloads/tps.go parses the file-size parameter via two helpers — fileSizeBytes() and fileSizeMBCount() — that accept only the form <int><K|M|G>. A value like 1.5G, 2GB, 10MiB, or garbage:
- Returns the fallback
10485760 bytes / "10" MB silently, with no log message or audit event
- The user gets a 10MB test file regardless of what they specified
The parser also reads only the final character as the unit suffix, so anything beyond a single suffix character is interpreted incorrectly.
Severity
Low — cosmetic or minor inconvenience
Affected Files
internal/workloads/tps.go — fileSize(), fileSizeBytes(), fileSizeMBCount()
internal/workloads/tps_test.go — coverage for malformed input
docs/configuration.md — note the supported format explicitly
Proposed Fix
Two-part:
- Document the supported format in
docs/configuration.md and docs/chaos-workloads.md: ^[0-9]+[KMG]$ (integer followed by a single unit suffix).
- Surface parse errors rather than silently substituting. Either:
- Bubble the error up through
CloudInitUserdata() so the orchestrator fails fast at workload-build time (preferred), or
- Emit a warning via
internal/logging and proceed with the default.
Add tests for both well-formed and malformed inputs.
Area
Workloads
Architecture Layer
Layer 3 - Workload Definitions (workloads, registry)
Category
Error handling gaps
Description
internal/workloads/tps.goparses thefile-sizeparameter via two helpers —fileSizeBytes()andfileSizeMBCount()— that accept only the form<int><K|M|G>. A value like1.5G,2GB,10MiB, orgarbage:10485760bytes /"10"MB silently, with no log message or audit eventThe parser also reads only the final character as the unit suffix, so anything beyond a single suffix character is interpreted incorrectly.
Severity
Low — cosmetic or minor inconvenience
Affected Files
internal/workloads/tps.go—fileSize(),fileSizeBytes(),fileSizeMBCount()internal/workloads/tps_test.go— coverage for malformed inputdocs/configuration.md— note the supported format explicitlyProposed Fix
Two-part:
docs/configuration.mdanddocs/chaos-workloads.md:^[0-9]+[KMG]$(integer followed by a single unit suffix).CloudInitUserdata()so the orchestrator fails fast at workload-build time (preferred), orinternal/loggingand proceed with the default.Add tests for both well-formed and malformed inputs.
Area
Workloads
Architecture Layer
Layer 3 - Workload Definitions (workloads, registry)