-
Notifications
You must be signed in to change notification settings - Fork 12
fix(xunix): also mount shared symlinked shared object files #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6607956
cc83a15
ef29aab
33766e3
7d91c01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,11 @@ fmt/go: | |
.PHONY: fmt/md | ||
fmt/md: | ||
go run github.com/Kunde21/markdownfmt/v3/cmd/[email protected] -w ./README.md | ||
|
||
.PHONY: test | ||
test: | ||
go test -v -count=1 ./... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: setting -count ignores test caching, if that's intended then 👍🏻 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, intended |
||
|
||
.PHONY: test-integration | ||
test-integration: | ||
go test -v -count=1 -tags=integration ./integration/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,28 +240,53 @@ func TestDocker(t *testing.T) { | |
require.Equal(t, "1000", strings.TrimSpace(string(out))) | ||
|
||
// Validate that memory limit is being applied to the inner container. | ||
out, err = integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
// First check under cgroupv2 path. | ||
if out, err = integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/memory/memory.limit_in_bytes"}, | ||
}) | ||
require.NoError(t, err) | ||
require.Equal(t, expectedMemoryLimit, strings.TrimSpace(string(out))) | ||
Cmd: []string{"cat", "/sys/fs/cgroup/memory.max"}, | ||
}); err == nil { | ||
require.Equal(t, expectedMemoryLimit, strings.TrimSpace(string(out))) | ||
} else { // fall back to cgroupv1 path. | ||
out, err = integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/memory/memory.limit_in_bytes"}, | ||
}) | ||
require.NoError(t, err) | ||
require.Equal(t, expectedMemoryLimit, strings.TrimSpace(string(out))) | ||
Comment on lines
+250
to
+255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only gets run when cgroup v2 fails or is unavailable, do we ever expect that to be the case with our supported versions? Since this test code only gets run when cgroup v2 fails, will it ever get run in CI or on our dev machines? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It ran on my dev machine ;-)
It would be a good idea to add CI to test across multiple distros where you get cgroupv1 and cgroupv2 by default. I'd prefer to keep that out of the scope of this PR though. |
||
} | ||
|
||
periodStr, err := integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
// Validate the cpu limits are being applied to the inner container. | ||
// First check under cgroupv2 path. | ||
var quota, period int64 | ||
if out, err = integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us"}, | ||
}) | ||
require.NoError(t, err) | ||
period, err := strconv.ParseInt(strings.TrimSpace(string(periodStr)), 10, 64) | ||
require.NoError(t, err) | ||
Cmd: []string{"cat", "/sys/fs/cgroup/cpu.max"}, | ||
}); err == nil { | ||
// out is in the format "period quota" | ||
// e.g. "100000 100000" | ||
fields := strings.Fields(string(out)) | ||
require.Len(t, fields, 2) | ||
period, err = strconv.ParseInt(fields[0], 10, 64) | ||
require.NoError(t, err) | ||
quota, err = strconv.ParseInt(fields[1], 10, 64) | ||
require.NoError(t, err) | ||
} else { // fall back to cgroupv1 path. | ||
periodStr, err := integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us"}, | ||
}) | ||
require.NoError(t, err) | ||
period, err = strconv.ParseInt(strings.TrimSpace(string(periodStr)), 10, 64) | ||
require.NoError(t, err) | ||
|
||
quotaStr, err := integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"}, | ||
}) | ||
require.NoError(t, err) | ||
quota, err := strconv.ParseInt(strings.TrimSpace(string(quotaStr)), 10, 64) | ||
require.NoError(t, err) | ||
quotaStr, err := integrationtest.ExecInnerContainer(t, pool, integrationtest.ExecConfig{ | ||
ContainerID: resource.Container.ID, | ||
Cmd: []string{"cat", "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"}, | ||
}) | ||
require.NoError(t, err) | ||
quota, err = strconv.ParseInt(strings.TrimSpace(string(quotaStr)), 10, 64) | ||
require.NoError(t, err) | ||
} | ||
|
||
// Validate that the CPU limit is being applied to the inner container. | ||
actualLimit := float64(quota) / float64(period) | ||
|
Uh oh!
There was an error while loading. Please reload this page.