helper/stub: write ready byte late
All checks were successful
Test / Create distribution (push) Successful in 27s
Test / Sandbox (race detector) (push) Successful in 41s
Test / Sandbox (push) Successful in 41s
Test / Hakurei (push) Successful in 44s
Test / Hakurei (race detector) (push) Successful in 44s
Test / Hpkg (push) Successful in 42s
Test / Flake checks (push) Successful in 1m30s
All checks were successful
Test / Create distribution (push) Successful in 27s
Test / Sandbox (race detector) (push) Successful in 41s
Test / Sandbox (push) Successful in 41s
Test / Hakurei (push) Successful in 44s
Test / Hakurei (race detector) (push) Successful in 44s
Test / Hpkg (push) Successful in 42s
Test / Flake checks (push) Successful in 1m30s
Hopefully eliminates spurious failures. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
763ab27e09
commit
a14b6535a6
@ -68,15 +68,8 @@ func genericStub(argsFile, statFile *os.File) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// simulate status pipe behaviour
|
|
||||||
if statFile != nil {
|
if statFile != nil {
|
||||||
if _, err := statFile.Write([]byte{'x'}); err != nil {
|
// simulate status pipe behaviour
|
||||||
panic("cannot write to status pipe: " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
done := make(chan struct{})
|
|
||||||
go func() {
|
|
||||||
// wait for status pipe close
|
|
||||||
var epoll int
|
var epoll int
|
||||||
if fd, err := syscall.EpollCreate1(0); err != nil {
|
if fd, err := syscall.EpollCreate1(0); err != nil {
|
||||||
panic("cannot open epoll fd: " + err.Error())
|
panic("cannot open epoll fd: " + err.Error())
|
||||||
@ -91,6 +84,12 @@ func genericStub(argsFile, statFile *os.File) {
|
|||||||
if err := syscall.EpollCtl(epoll, syscall.EPOLL_CTL_ADD, int(statFile.Fd()), &syscall.EpollEvent{}); err != nil {
|
if err := syscall.EpollCtl(epoll, syscall.EPOLL_CTL_ADD, int(statFile.Fd()), &syscall.EpollEvent{}); err != nil {
|
||||||
panic("cannot add status pipe to epoll: " + err.Error())
|
panic("cannot add status pipe to epoll: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := statFile.Write([]byte{'x'}); err != nil {
|
||||||
|
panic("cannot write to status pipe: " + err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait for status pipe close
|
||||||
events := make([]syscall.EpollEvent, 1)
|
events := make([]syscall.EpollEvent, 1)
|
||||||
if _, err := syscall.EpollWait(epoll, events, -1); err != nil {
|
if _, err := syscall.EpollWait(epoll, events, -1); err != nil {
|
||||||
panic("cannot poll status pipe: " + err.Error())
|
panic("cannot poll status pipe: " + err.Error())
|
||||||
@ -99,8 +98,5 @@ func genericStub(argsFile, statFile *os.File) {
|
|||||||
panic(strconv.Itoa(int(events[0].Events)))
|
panic(strconv.Itoa(int(events[0].Events)))
|
||||||
|
|
||||||
}
|
}
|
||||||
close(done)
|
|
||||||
}()
|
|
||||||
<-done
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user