Skip to content

Commit

Permalink
quick upstream test update
Browse files Browse the repository at this point in the history
  • Loading branch information
miledxz committed Aug 20, 2024
1 parent 27fed56 commit 8b94a05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions internal/mode/static/nginx/runtime/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate

const (
// PidFile specifies the location of the PID file for the Nginx process
// PidFile specifies the location of the PID file for the Nginx process.
PidFile = "/var/run/nginx/nginx.pid"
// PidFileTimeout defines the timeout duration for accessing the PID file
// PidFileTimeout defines the timeout duration for accessing the PID file.
PidFileTimeout = 10000 * time.Millisecond
// NginxReloadTimeout sets the timeout duration for reloading the Nginx configuration
// NginxReloadTimeout sets the timeout duration for reloading the Nginx configuration.
NginxReloadTimeout = 60000 * time.Millisecond
)

Expand Down Expand Up @@ -239,7 +239,7 @@ func (p *ProcessHandlerImpl) FindMainProcess(
}

func (p *ProcessHandlerImpl) ReadFile(file string) ([]byte, error) {
return p.ReadFile(file)
return p.readFile(file)

Check warning on line 242 in internal/mode/static/nginx/runtime/manager.go

View check run for this annotation

Codecov / codecov/patch

internal/mode/static/nginx/runtime/manager.go#L241-L242

Added lines #L241 - L242 were not covered by tests
}

func (p *ProcessHandlerImpl) Kill(pid int) error {
Expand Down
12 changes: 5 additions & 7 deletions internal/mode/static/nginx/runtime/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,16 @@ var _ = Describe("NGINX Runtime Manager", func() {
Peers: []ngxclient.Peer{
{ID: 1, Name: "peer1-name"},
},
Queue: ngxclient.Queue{Size: 10},
Keepalives: 5,
Zombies: 2,
Queue: ngxclient.Queue{Size: 10},
Zombies: 2,
},
"upstream2": {
Zone: "zone2",
Peers: []ngxclient.Peer{
{ID: 2, Name: "peer2-name"},
},
Queue: ngxclient.Queue{Size: 20},
Keepalives: 3,
Zombies: 1,
Queue: ngxclient.Queue{Size: 20},
Zombies: 1,
},
}

Expand All @@ -184,7 +182,7 @@ var _ = Describe("NGINX Runtime Manager", func() {
upstreams, err := manager.GetUpstreams()

Expect(err).NotTo(HaveOccurred())
Expect(upstreams).To(Equal(expUpstreams))
Expect(expUpstreams).To(Equal(upstreams))
})

It("returns an error when GetUpstreams fails", func() {
Expand Down

0 comments on commit 8b94a05

Please sign in to comment.