Skip to content
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

Fix flaky test TestNotifyOnOOM #1556

Merged

Conversation

hqhq
Copy link
Contributor

@hqhq hqhq commented Aug 14, 2017

Fixes: #1228

It can be reproduced by applying this patch:

@@ -45,6 +46,7 @@ func registerMemoryEvent(cgDir string, evName string, arg string) (<-chan struct
        go func() {
                defer func() {
                        close(ch)
+                       <-time.After(1 * time.Second)
                        eventfd.Close()
                        evFile.Close()
                }()

We can close channel after fds were closed.

Signed-off-by: Qiang Huang [email protected]

hqhq added 2 commits August 14, 2017 15:18
Fixes: opencontainers#1228

It can be reproduced by applying this patch:
```diff
@@ -45,6 +46,7 @@ func registerMemoryEvent(cgDir string, evName string, arg string) (<-chan struct
        go func() {
                defer func() {
                        close(ch)
+                       <-time.After(1 * time.Second)
                        eventfd.Close()
                        evFile.Close()
                }()
```

We can close channel after fds were closed.

Signed-off-by: Qiang Huang <[email protected]>
@cyphar
Copy link
Member

cyphar commented Aug 14, 2017

LGTM.

Approved with PullApprove

@TomSweeneyRedHat
Copy link

LGTM

@crosbymichael
Copy link
Member

crosbymichael commented Aug 14, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit 3096b3f into opencontainers:master Aug 14, 2017
@hqhq hqhq deleted the fix_flakytest_TestNotifyOnOOM branch August 15, 2017 01:14
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.

FlakyTest: TestNotifyOnOOM
4 participants