Skip to content

cmd/initContainer: Style fix#1636

Merged
debarshiray merged 3 commits intocontainers:mainfrom
debarshiray:wip/rishi/cmd-simplify-string-building-part2
May 1, 2025
Merged

cmd/initContainer: Style fix#1636
debarshiray merged 3 commits intocontainers:mainfrom
debarshiray:wip/rishi/cmd-simplify-string-building-part2

Conversation

@debarshiray
Copy link
Copy Markdown
Member

Use a strings.Builder [1] instance instead of raw string literals for
consistency.

Fallout from 772b66b

[1] https://pkg.go.dev/strings#Builder

The system tests can be very I/O intensive, because many of them copy
OCI images from the test suite's image cache directory to its local
container/storage store, create containers, and then delete everything
to run the next test with a clean slate.  This makes them slow.

The tests for toolbox(1) invocations forwarded to the host, which
includes the help tests, are particularly slow because they never skip
the I/O.  This makes them a good target for optimizations.

The help tests for toolbox(1) invocations forwarded to the host use the
same default Toolbx container to invoke toolbox(1) from without changing
its state.  Therefore, a lot of disk I/O can be avoided by creating the
default container only once for all those tests.

This can reduce the time needed to run the help tests from almost 7
minutes to a few seconds.

containers#1635
@debarshiray debarshiray requested a review from martymichal as a code owner May 1, 2025 16:30
debarshiray added a commit to debarshiray/toolbox that referenced this pull request May 1, 2025
Use a strings.Builder [1] instance instead of raw string literals for
consistency.

Fallout from 772b66b

[1] https://pkg.go.dev/strings#Builder

containers#1636
@debarshiray debarshiray force-pushed the wip/rishi/cmd-simplify-string-building-part2 branch from c61d864 to 3f719a9 Compare May 1, 2025 16:30
@softwarefactory-project-zuul
Copy link
Copy Markdown

The system tests can be very I/O intensive, because many of them copy
OCI images from the test suite's image cache directory to its local
container/storage store, create containers, and then delete everything
to run the next test with a clean slate.  This makes them slow.

The runtime environment tests, which includes the group and user tests,
are particularly slow because they don't skip the I/O even when testing
error handling.  This makes them a good target for optimizations.

The group and user tests check the group and user configuration in
different containers without changing their state.  Therefore, a lot of
disk I/O can be avoided by creating these containers only once for all
the tests.

This can reduce the time needed to run the group and user tests from
almost 22 minutes to almost 5 minutes.

containers#1635
Use a strings.Builder [1] instance instead of raw string literals for
consistency.

Fallout from 772b66b

[1] https://pkg.go.dev/strings#Builder

containers#1636
@debarshiray debarshiray force-pushed the wip/rishi/cmd-simplify-string-building-part2 branch from 3f719a9 to 02fe08f Compare May 1, 2025 18:28
@softwarefactory-project-zuul
Copy link
Copy Markdown

@debarshiray
Copy link
Copy Markdown
Member Author

recheck

@softwarefactory-project-zuul
Copy link
Copy Markdown

@debarshiray debarshiray merged commit 02fe08f into containers:main May 1, 2025
3 checks passed
@debarshiray debarshiray deleted the wip/rishi/cmd-simplify-string-building-part2 branch May 1, 2025 23:02
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.

1 participant