Skip to content

test/system: Optimize the networking tests#1637

Merged
debarshiray merged 6 commits intocontainers:mainfrom
debarshiray:wip/rishi/test-system-203-network-optimize-container-creation
May 1, 2025
Merged

test/system: Optimize the networking tests#1637
debarshiray merged 6 commits intocontainers:mainfrom
debarshiray:wip/rishi/test-system-203-network-optimize-container-creation

Conversation

@debarshiray
Copy link
Copy Markdown
Member

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 networking 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 networking tests check the behaviour and configuration of the
network 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 networking tests from almost
15 minutes to almost 6 minutes.

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
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
A subsequent commit will use this to give Toolbx containers access to
the certificates from certificate authorities on the host.  This commit
was kept separate from the changes to toolbox(1) to ensure that the
ubuntu-toolbox images are ready before that happens.

Unfortunately, Ubuntu 16.04 Xenial Xerus has p11-kit 0.23.2 [1], while
p11-kit-client.so was introduced in p11-kit 0.23.10 [2].  Therefore,
this feature will be disabled for Ubuntu 16.04.

This reverts parts of commit 1e93086 to
re-enable building the ubuntu-toolbox:18.04 image.

[1] https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/p11-kit/+git/p11-kit/+ref/ubuntu/xenial-updates

[2] p11-kit commit 0684cd7b7f815b41
    p11-glue/p11-kit@0684cd7b7f815b41
    p11-glue/p11-kit#15

containers#626
The libp11-kit package was added to the arch-toolbox image to ensure the
presence of p11-kit-client.so.  Currently, the package is already pulled
in by various dependencies, like the gnutls and p11-kit packages.
Therefore, it doesn't increase the size of the base image, but serves as
a safeguard against any inadvertent changes.

A subsequent commit will use this to give Toolbx containers access to
the certificates from certificate authorities on the host.  This commit
was kept separate from the changes to toolbox(1) to ensure that the
arch-toolbox image is ready before that happens.

containers#626
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 networking 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 networking tests check the behaviour and configuration of the
network 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 networking tests from almost
15 minutes to almost 6 minutes.

containers#1637
@debarshiray debarshiray force-pushed the wip/rishi/test-system-203-network-optimize-container-creation branch from 17f0257 to 1b9dd00 Compare May 1, 2025 21:33
@softwarefactory-project-zuul
Copy link
Copy Markdown

@debarshiray debarshiray merged commit 1b9dd00 into containers:main May 1, 2025
8 of 9 checks passed
@debarshiray debarshiray deleted the wip/rishi/test-system-203-network-optimize-container-creation branch May 1, 2025 23:06
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jan 27, 2026
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 networking 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 networking tests check the behaviour and configuration of the
network 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 networking tests from almost
15 minutes to almost 6 minutes.

containers#1637
containers#1746
(cherry picked from commit 1b9dd00)
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Feb 4, 2026
Both the commands and options tests [1,2], and runtime environment
tests [3,4,5,6] were optimized by avoiding a lot of disk I/O.

Fallout from 40e3c5a

[1] Commit adc8650
    containers@adc8650660b454f3
    containers#1595

[2] Commit 69d6b11
    containers@69d6b11a9b91ccbf
    containers#1635

[3] Commit 3017a46
    containers@3017a46c03c963ef
    containers#1635

[4] Commit 1b9dd00
    containers@1b9dd007ea1d0778
    containers#1637

[5] Commit 5881bc4
    containers@5881bc43f34815b1
    containers#1641

[6] Commit 836c055
    containers@836c0557f4dc100b
    containers#1646
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Feb 4, 2026
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