Some fixes for testMemoryNotification
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
40a1fb0e2f
commit
7726bcf0e2
|
@ -53,16 +53,12 @@ func testMemoryNotification(t *testing.T, evName string, notify notifyFunc, targ
|
|||
t.Fatalf("invalid control data %q: %s", data, err)
|
||||
}
|
||||
|
||||
// re-open the eventfd
|
||||
// dup the eventfd
|
||||
efd, err := unix.Dup(eventFd)
|
||||
if err != nil {
|
||||
t.Fatal("unable to reopen eventfd:", err)
|
||||
}
|
||||
defer unix.Close(efd)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal("unable to dup eventfd:", err)
|
||||
}
|
||||
defer unix.Close(efd)
|
||||
|
||||
buf := make([]byte, 8)
|
||||
binary.LittleEndian.PutUint64(buf, 1)
|
||||
|
@ -93,6 +89,7 @@ func testMemoryNotification(t *testing.T, evName string, notify notifyFunc, targ
|
|||
t.Fatal("expected no notification to be triggered")
|
||||
}
|
||||
case <-time.After(100 * time.Millisecond):
|
||||
t.Fatal("channel not closed after 100ms")
|
||||
}
|
||||
|
||||
if _, _, err := unix.Syscall(unix.SYS_FCNTL, uintptr(evFd), unix.F_GETFD, 0); err != unix.EBADF {
|
||||
|
|
Loading…
Reference in New Issue