mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
test(sharness): improve reliability of ma-pipe-unidir
Write the PID file after listening.
This commit is contained in:
parent
02338478e0
commit
67da056908
@ -43,16 +43,6 @@ func app() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
maddr, err := ma.NewMultiaddr(addr)
|
||||
if err != nil {
|
||||
return 1
|
||||
@ -66,6 +56,16 @@ func app() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
conn, err = listener.Accept()
|
||||
if err != nil {
|
||||
return 1
|
||||
@ -76,6 +76,17 @@ func app() int {
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
@ -84,7 +84,7 @@ test_expect_success 'S->C Setup(dnsaddr/addr/ipfs/peerID) client side' '
|
||||
'
|
||||
|
||||
test_expect_success 'S->C Setup(dnsaddr/addr) client side' '
|
||||
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10104 /dnsaddr/bootstrap.libp2p.io/ 2>&1 > dialer-stdouterr.log
|
||||
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10104 /dnsaddr/bootstrap.libp2p.io 2>&1 > dialer-stdouterr.log
|
||||
'
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user