Skip to content

topology-aware: uncompress the test sysfs data once - #872

Merged
klihub merged 1 commit into
containers:mainfrom
bart0sh:PR011-uncompress-sysfs-once
Oct 23, 2026
Merged

klihub merged 1 commit into
containers:mainfrom
bart0sh:PR011-uncompress-sysfs-once

Conversation

@bart0sh

@bart0sh bart0sh commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Each topology-aware policy test uncompressed the test sysfs tarball into a directory of its own. The tarball expands to 222 MB in about 64,000 files, so with -race the package came close to the default 10 minute timeout of go test. The tests now share one copy. It is uncompressed once and removed when the tests finish. The shared copy is read-only, so a test which changes it fails. The one test which changes the data keeps a private copy.

go test ./cmd/plugins/topology-aware/policy/ before after
without -race 275s 36s
with -race 718s 95s

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Initialization is synchronized, cleanup preserves test results, and the fixture-mutating test remains isolated.

No open issues 🎉

What changed in this PR

This PR reduces topology-aware policy test runtime by sharing one extracted sysfs fixture across tests instead of repeatedly unpacking it.

Changes:

  • Initializes the shared fixture once with sync.Once and reports extraction failures to tests.
  • Adds suite-level cleanup in TestMain, preserving the test exit code and reporting cleanup errors.
File Description
cmd/​plugins/​topology-aware/​policy/​pools_test.go Shares sysfs fixture initialization and removes the extracted data after the test suite finishes.

Review effort: Balanced

@bart0sh
bart0sh marked this pull request as draft October 23, 2026 05:39
@bart0sh
bart0sh force-pushed the PR011-uncompress-sysfs-once branch from 4930ab5 to 28df8aa Compare October 23, 2026 05:43
Each test uncompressed the whole tarball, which takes about 20s with
-race, so the package hit the default 10m timeout of go test. Share
one copy across the tests instead. The shared copy is read-only, so a
test which changes it fails.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
@bart0sh
bart0sh force-pushed the PR011-uncompress-sysfs-once branch from 28df8aa to 8d1f80d Compare October 23, 2026 05:55
@bart0sh
bart0sh requested a balanced review from Copilot October 23, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues were identified in fixture initialization, isolation, permission handling, or cleanup.

No open issues 🎉

Review effort: Balanced

@bart0sh
bart0sh marked this pull request as ready for review October 23, 2026 06:28
@bart0sh
bart0sh requested review from askervin and klihub October 23, 2026 06:28

@askervin askervin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@klihub
klihub merged commit 31fdac0 into containers:main Oct 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants