Skip to content

fix TestSetOOMScoreBoundaries and replace missing busybox image in CI#5321

Merged
crosbymichael merged 2 commits intocontainerd:masterfrom
thaJeztah:fix_oom_score_test
Apr 8, 2021
Merged

fix TestSetOOMScoreBoundaries and replace missing busybox image in CI#5321
crosbymichael merged 2 commits intocontainerd:masterfrom
thaJeztah:fix_oom_score_test

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Apr 8, 2021

updates / closes #5320

Introduced in 4424011 / #5253
To address the failure described in #5320 (comment)

Setting the oom-score-adj to -1000 is only possible if the parent process
either has no score set, or if the score is set to -1000.

However, the current implementation of GetOOMScoreAdj conflates situations
where either no oom-score is set, or oom-score is set, but set to 0.

In the latter case, the test would fail:

--- FAIL: TestSetOOMScoreBoundaries (0.01s)
    oom_linux_test.go:79: assertion failed: 0 (adjustment int) != -1000 (OOMScoreAdjMin int)
FAIL

To prevent failures in this situation, skip that part of the test in the
above situation.

Also update the description of GetOOMScoreAdj to clarify its behavior.

Signed-off-by: Sebastiaan van Stijn [email protected]

```bash
curl -s https://mirror.gcr.io//v2/library/busybox/tags/list | jq '[.tags ]'
[
  [
    "1.26.2",
    "1.27.2",
    "1.28",
    "1.29",
    "1.29.2",
    "1.30",
    "1.30.1",
    "1.31",
    "1.31.0",
    "1.31.1",
    "1.32.0"
  ]
]
```

The latest is gone. I think we should setup image in github container
registry for CI if possible.

Signed-off-by: Wei Fu <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

@fuweid @AkihiroSuda @mxpv ptal

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Apr 8, 2021

I think CI will unhappy 😂 @thaJeztah Would you mind to add my commit from #5320 in this pr? Thanks

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 8, 2021

Build succeeded.

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Apr 8, 2021

default: time="2021-04-08T10:26:34Z" level=info msg="start to pull seed image" image="mirror.gcr.io/library/busybox:latest"
default: failed to resolve reference "mirror.gcr.io/library/busybox:latest": mirror.gcr.io/library/busybox:latest: not found: time="2021-04-08T10:26:34.887254272Z" level=info msg="starting containerd" revision=16923ef121ac1b97f112759f35c109ac86cdbe6e.m version=16923ef.m

Yeah... no surprise

@thaJeztah
Copy link
Copy Markdown
Member Author

I think CI will unhappy 😂 @thaJeztah Would you mind to add my commit from #5320 in this pr? Thanks

Ah, yes, I anticipated that; let me rebase my PR on top of yours

(this was introduced in 4424011)

Setting the oom-score-adj to -1000 is only possible if the parent process
either has no score set, or if the score is set to -1000.

However, the current implementation of GetOOMScoreAdj conflates situations
where either _no_ oom-score is set, _or_ oom-score is set, but set to 0.

In the latter case, the test would fail:

    --- FAIL: TestSetOOMScoreBoundaries (0.01s)
        oom_linux_test.go:79: assertion failed: 0 (adjustment int) != -1000 (OOMScoreAdjMin int)
    FAIL

To prevent failures in this situation, skip that part of the test in the
above situation.

Also update the description of GetOOMScoreAdj to clarify its behavior.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the fix_oom_score_test branch from 1cc3b72 to 3d20fa9 Compare April 8, 2021 11:14
@thaJeztah
Copy link
Copy Markdown
Member Author

Rebased to include #5320 (merging this PR will merge both)

@thaJeztah thaJeztah changed the title fix TestSetOOMScoreBoundaries fix TestSetOOMScoreBoundaries and replace missing busybox image in CI Apr 8, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 8, 2021

Build succeeded.

@thaJeztah
Copy link
Copy Markdown
Member Author

thaJeztah commented Apr 8, 2021

And now it's failing on the next image 😞

/tmp/tmp.VgIjkcLzf0/cri-tools/pkg/validate/image.go:148

  failed to pull image: rpc error: code = NotFound desc = failed to pull and unpack image "gcr.io/k8s-staging-cri-tools/test-image-tags:1": failed to prepare extraction snapshot "extract-152793486-oD6a sha256:4ee8075a5f4e716c593efb58af728bbd8a9f4ce4d04bb81870259451f2563ba3": parent snapshot sha256:2983725f2649f8847244cbb73ff9cb0b041bd319144816dfdee904adfd18bd1f does not exist: not found

Hm.. is that the image, or is that extraction that has an issue?

Update: ☝️ is a known flaky / race condition, and not related to the gcr.io image

@thaJeztah thaJeztah closed this Apr 8, 2021
@thaJeztah thaJeztah reopened this Apr 8, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 8, 2021

Build succeeded.

@thaJeztah
Copy link
Copy Markdown
Member Author

thaJeztah commented Apr 8, 2021

Another flaky? (is it state not cleaned up somewhere?)

-- FAIL: TestContentClient/CommitErrorState (3.39s)
unlinkat /var/lib/containerd-test/io.containerd.content.v1.content/ingest/9101c5f249b4cb38a50dddda86a787c09f31099573c87c525fc50774ac21d05d: directory not empty

details below

Details
=== RUN   TestContentClient/CommitErrorState
    testsuite.go:119: Cleanup failed: unknown
        github.com/containerd/containerd/errdefs.init
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/errdefs/errors.go:43
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5652
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5647
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5647
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5647
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5647
        runtime.doInit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:5647
        runtime.main
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/proc.go:191
        runtime.goexit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/asm_amd64.s:1374
        unlinkat /var/lib/containerd-test/io.containerd.content.v1.content/ingest/9101c5f249b4cb38a50dddda86a787c09f31099573c87c525fc50774ac21d05d: directory not empty
        github.com/containerd/containerd/errdefs.FromGRPC
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/errdefs/grpc.go:107
        github.com/containerd/containerd/content/proxy.(*proxyContentStore).Abort
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/content/proxy/content_store.go:187
        github.com/containerd/containerd/integration/client.newContentStore.func2
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/integration/client/content_test.go:61
        github.com/containerd/containerd/content/testsuite.makeTest.func1.1
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/content/testsuite/testsuite.go:118
        github.com/containerd/containerd/content/testsuite.makeTest.func1
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/content/testsuite/testsuite.go:139
        testing.tRunner
        	/opt/hostedtoolcache/go/1.15.11/x64/src/testing/testing.go:1123
        runtime.goexit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/asm_amd64.s:1374
        failed to abort c1-commiterror-state
        github.com/containerd/containerd/integration/client.newContentStore.func2
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/integration/client/content_test.go:62
        github.com/containerd/containerd/content/testsuite.makeTest.func1.1
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/content/testsuite/testsuite.go:118
        github.com/containerd/containerd/content/testsuite.makeTest.func1
        	/home/runner/work/containerd/containerd/src/github.com/containerd/containerd/content/testsuite/testsuite.go:139
        testing.tRunner
        	/opt/hostedtoolcache/go/1.15.11/x64/src/testing/testing.go:1123
        runtime.goexit
        	/opt/hostedtoolcache/go/1.15.11/x64/src/runtime/asm_amd64.s:1374
--- FAIL: TestContentClient (4.40s)
    --- PASS: TestContentClient/Writer (0.03s)
    --- PASS: TestContentClient/UpdateStatus (0.02s)
    --- PASS: TestContentClient/CommitExists (0.02s)
    --- PASS: TestContentClient/Resume (0.02s)
    --- PASS: TestContentClient/ResumeTruncate (0.17s)
    --- PASS: TestContentClient/ResumeDiscard (0.18s)
    --- PASS: TestContentClient/ResumeCopy (0.19s)
    --- PASS: TestContentClient/ResumeCopySeeker (0.17s)
    --- PASS: TestContentClient/ResumeCopyReaderAt (0.19s)
    --- PASS: TestContentClient/SmallBlob (0.01s)
    --- PASS: TestContentClient/Labels (0.01s)
    --- FAIL: TestContentClient/CommitErrorState (3.39s)

@thaJeztah thaJeztah closed this Apr 8, 2021
@thaJeztah thaJeztah reopened this Apr 8, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 8, 2021

Build succeeded.

@thaJeztah
Copy link
Copy Markdown
Member Author

yay! green now

Comment thread sys/oom_linux.go
Comment thread sys/oom_linux.go
Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@crosbymichael crosbymichael merged commit ceb0875 into containerd:master Apr 8, 2021
@thaJeztah thaJeztah deleted the fix_oom_score_test branch April 8, 2021 19:35
@thaJeztah
Copy link
Copy Markdown
Member Author

sore -> score
nvm I see derek saw it too

Sorry; missed both of those comments; I'll try to think of fixing that separately (or wait for a contributor to open a "fix typo" PR); getting CI working is the important bit 👍

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.

6 participants