wings/server/power_test.go
Dane Everitt 2b2b5200eb Rewrite console throttling logic; drop complex timer usage and use a very simple throttle
This also removes server process termination logic when a server is breaching the output limits. It simply continues to efficiently throttle the console output.
2022-01-30 19:31:04 -05:00

23 lines
445 B
Go

package server
import (
"testing"
. "github.com/franela/goblin"
"github.com/pterodactyl/wings/system"
)
func TestPower(t *testing.T) {
g := Goblin(t)
g.Describe("Server#ExecutingPowerAction", func() {
g.It("should return based on locker status", func() {
s := &Server{powerLock: system.NewLocker()}
g.Assert(s.ExecutingPowerAction()).IsFalse()
s.powerLock.Acquire()
g.Assert(s.ExecutingPowerAction()).IsTrue()
})
})
}