test: stabilize distributed load verification

This commit is contained in:
richjohnrambo
2026-09-28 09:50:33 +08:00
parent d3c679878d
commit a974572f72
12 changed files with 344 additions and 46 deletions
+16 -2
View File
@@ -35,8 +35,10 @@ type Config struct {
HistoryWorkers int `json:"history_workers"`
HistoryPageSize int `json:"history_page_size"`
HistoryInterval string `json:"history_query_interval"`
HistoryPageWait string `json:"history_page_wait"`
HistorySettle string `json:"history_settle"`
HistoryTimeout string `json:"history_timeout"`
CloseRamp string `json:"close_ramp"`
PreflightWorkers int `json:"preflight_workers"`
SkipP2PPreflight bool `json:"skip_p2p_preflight"`
}
@@ -84,13 +86,13 @@ func loadConfig(path string) (*Config, error) {
cfg.DrainGroup = "60s"
}
if cfg.HistoryWorkers <= 0 {
cfg.HistoryWorkers = 1
cfg.HistoryWorkers = 12
}
if cfg.HistoryWorkers > 128 {
return nil, errors.New("history_workers must not exceed 128")
}
if cfg.HistoryPageSize <= 0 {
cfg.HistoryPageSize = 20
cfg.HistoryPageSize = 10
}
if cfg.HistoryPageSize > 200 {
return nil, errors.New("history_page_size must not exceed 200")
@@ -101,6 +103,12 @@ func loadConfig(path string) (*Config, error) {
if _, err = configDuration(cfg.HistoryInterval); err != nil {
return nil, fmt.Errorf("history_query_interval: %w", err)
}
if cfg.HistoryPageWait == "" {
cfg.HistoryPageWait = "3s"
}
if _, err = configDuration(cfg.HistoryPageWait); err != nil {
return nil, fmt.Errorf("history_page_wait: %w", err)
}
if cfg.HistoryTimeout == "" {
cfg.HistoryTimeout = "3m"
}
@@ -113,6 +121,12 @@ func loadConfig(path string) (*Config, error) {
if _, err = configDuration(cfg.HistoryTimeout); err != nil {
return nil, fmt.Errorf("history_timeout: %w", err)
}
if cfg.CloseRamp == "" {
cfg.CloseRamp = "10s"
}
if _, err = configDuration(cfg.CloseRamp); err != nil {
return nil, fmt.Errorf("close_ramp: %w", err)
}
if cfg.PreflightWorkers <= 0 {
cfg.PreflightWorkers = 32
}