40 lines
867 B
Go
40 lines
867 B
Go
package load
|
||
|
||
import (
|
||
"testing"
|
||
"time"
|
||
|
||
"git.asio.asia/nixevol/NixMsg/test/harness"
|
||
)
|
||
|
||
const epPassword = "password1234"
|
||
|
||
// TestQ3LiveShortBurst 短时真实登录+单聊,覆盖原先 Q3 冒烟;完整 50×1m 见 TestLocalLoadReport。
|
||
func TestQ3LiveShortBurst(t *testing.T) {
|
||
srv, err := harness.Start(harness.Options{})
|
||
if err != nil {
|
||
t.Fatal(err)
|
||
}
|
||
defer func() { _ = srv.Stop() }()
|
||
|
||
cfg := Config{
|
||
HTTPBase: srv.HTTPBase,
|
||
AdminPass: srv.AdminPassword,
|
||
Password: epPassword,
|
||
Prefix: "q3",
|
||
N: 8,
|
||
Rate: 10,
|
||
Duration: 3 * time.Second,
|
||
GroupSize: 8,
|
||
Scenario: "all",
|
||
}
|
||
rep, err := Run(cfg)
|
||
if err != nil {
|
||
t.Fatal(err)
|
||
}
|
||
if rep.Disconnects != 0 || rep.SubmitMs.N == 0 || len(rep.Errors) != 0 || rep.GroupMembers != 8 {
|
||
t.Fatalf("%s", rep.Format())
|
||
}
|
||
t.Logf("短时压测通过:\n%s", rep.Format())
|
||
}
|