Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed Jun 29, 2022
1 parent 7ff2538 commit c2d5fb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions prefork.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (app *App) prefork(addr string, tlsConfig *tls.Config, cfg StartConfig) (er
cmd.Env = append(os.Environ(),
fmt.Sprintf("%s=%s", envPreforkChildKey, envPreforkChildVal),
)

if err = cmd.Start(); err != nil {
return fmt.Errorf("failed to start a child prefork process, error: %v", err)
}
Expand Down
2 changes: 2 additions & 0 deletions prefork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func Test_App_Prefork_Master_Process(t *testing.T) {

err := app.prefork("127.0.0.1:", nil, startConfigDefault())
utils.AssertEqual(t, false, err == nil)

dummyChildCmd = "go"
}

func Test_App_Prefork_Child_Process_Never_Show_Startup_Message(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions start.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ func startConfigDefault(config ...StartConfig) StartConfig {
return cfg
}

// Listen serves HTTP requests from the given addr.
// Start serves HTTP requests from the given addr.
// You should enter custom StartConfig to customize startup. (TLS, mTLS, prefork...)
//
// app.Listen(":8080")
// app.Listen("127.0.0.1:8080")
// app.Listen(":8080", StartConfig{EnablePrefork: true})
// app.Start(":8080")
// app.Start("127.0.0.1:8080")
// app.Start(":8080", StartConfig{EnablePrefork: true})
func (app *App) Start(addr any, config ...StartConfig) error {
cfg := startConfigDefault(config...)

Expand Down

2 comments on commit c2d5fb3

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: c2d5fb3 Previous: 95f9a3f Ratio
Benchmark_AcquireCtx 573.2 ns/op 1440 B/op 5 allocs/op 38.19 ns/op 0 B/op 0 allocs/op 15.01
Benchmark_Ctx_Protocol 15.37 ns/op 0 B/op 0 allocs/op 2.3 ns/op 0 B/op 0 allocs/op 6.68

This comment was automatically generated by workflow using github-action-benchmark.

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: c2d5fb3 Previous: 95f9a3f Ratio
Benchmark_AcquireCtx 786 ns/op 1440 B/op 5 allocs/op 38.19 ns/op 0 B/op 0 allocs/op 20.58
Benchmark_Ctx_Protocol 17.45 ns/op 0 B/op 0 allocs/op 2.3 ns/op 0 B/op 0 allocs/op 7.59

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.