e2e: add topology-aware coldstart test. #826
@bart0sh I went ahead and added the missing bits for emulating PMEM in our e2e VMs and an e2e test for coldstart.
typo: discoer -> discover
Fixed.
This sets all node types(even PMEM and HBM ones) absent in overrides to MemoryTypeDRAM. Should we iterate over memTypeEnvOverrides and override only nodes present there?
The detection/overrides is either/or. We either 1) let all nodes' memory types be determined using the original size-based estimation, or 2) take all memory types from the environment with missing entries defaulting to DRAM (MemoryType 0).
But I updated the loop now to make this more explicit and to not rely on the map zero type being == DRAM for the defaults.
Would it make sense to also validate node id here so that non-existent/mistyped node ids are not silently ignored?
Understood. Thanks for the explanations!
Looks good. And @bart0sh has a good point.
Added error for referencing non-existent node IDs.
LGTM
This cache is process-global even though parsing validates IDs against this particular sys.nodes. After one DiscoverSystemAt call populates it, later discoveries of a different sysfs tree skip validation and reuse the first system's result; concurrent discoveries also race on the map initialization. Keep the parsed overrides on the system instance (or revalidate them for every system, with synchronized immutable parsing) so each exported discovery call gets correct validation.
The 3-second timer starts in ContainerStarted, but create does not return until Kubernetes reports the pod Ready. If readiness observation takes three seconds, the timer has already restored DRAM and the immediate PMEM-only assertion fails even though cold start works. Use a comfortably longer cold-start window for the initial assertion, then poll for the final memory set with a bounded timeout instead of relying on fixed sleeps.
The new parser's malformed JSON, unknown type, nonexistent-node, case-normalization, and successful mapping paths are not covered by focused sysfs tests; the e2e test exercises only one valid value. Add table-driven unit coverage so changes to this environment-facing validation cannot silently alter startup behavior.
<!-- ccr-overview-v2 -->
Copilot review overview
🟡 Changes recommended
Global override caching and timing-sensitive assertions can produce incorrect discovery behavior and flaky tests.
Review effort: Balanced
Findings: 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> · 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> · 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture>
<details open>
<summary><strong>Open (3)</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
Adds end-to-end coverage for topology-aware cold starts, building on PR #824.
Changes:
| File | Description |
| ---- | ----------- |
| pkg/sysfs/system.go | Parses and applies memory-type overrides. |
| test/e2e/lib/test.bash | Adds live memory-set inspection. |
| test/e2e/policies.test-suite/topology-aware/n4c16/test20-coldstart/code.var.sh | Adds cold-start e2e coverage. |
</details>
---
💡 <a href="/containers/nri-plugins/new/main?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>
Moved verification (of overriding non-existent nodes) to the DiscoverSystemAt code path. We don't care about initialization races, as overrides are for tests only. Should care about/fix it for all overrides or none.
/lgtm
askervin
klihub
Note: this PR is based on #824. Please review that first.
Add environment overrides for memory types and a coldstart test for the topology-aware policy.