Skip to content

Commit

Permalink
example/php: Further improve tests
Browse files Browse the repository at this point in the history
* Improve error handling of internal tools.
  • Loading branch information
yookoala committed Oct 13, 2020
1 parent 4b3caef commit 5ff04ee
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tools/phpfpm/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,23 @@ func ExampleProcess() {
process.User = username

// save the config file to basepath + "/etc/php-fpm.conf"
process.SaveConfig(basepath + "/etc/example.conf")
process.Start()
if err := process.SaveConfig(basepath + "/etc/example.conf"); err != nil {
panic(err)
}
if err := process.Start(); err != nil {
panic(err)
}

go func() {
// do something that needs phpfpm
// ...
time.Sleep(time.Millisecond * 50)
process.Stop()
_ = process.Stop()
}()

process.Wait()
if err := process.Wait(); err != nil {
panic(err)
}

// Output:
}

0 comments on commit 5ff04ee

Please sign in to comment.