mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
Running() reads the process under the manager's lock; the early-exit flag is atomic; a second Close no longer waits on the reaped process; an empty log chunk no longer panics. The observatory producer rejects tags it cannot map instead of attributing them to the first node, paces every path so an unknown tag cannot spin it, closes an unavailable connection before dropping it and cancels each dial context at once. Balancer outbounds get their serverInfoMap entry on success, not only on failure. The resolv hijacker is serialised between the start path and the connectivity monitor.
27 lines
636 B
Go
27 lines
636 B
Go
package v2ray
|
|
|
|
import "testing"
|
|
|
|
func TestProcessCloseMarksExpectedStopBeforeCancel(t *testing.T) {
|
|
process := &Process{template: &Template{}}
|
|
process.procCancel = func() {
|
|
if !process.expectedStop.Load() {
|
|
t.Fatal("expected stop must be recorded before canceling the core")
|
|
}
|
|
}
|
|
|
|
if err := process.Close(); err != nil {
|
|
t.Fatalf("Close() error = %v", err)
|
|
}
|
|
if !process.expectedStop.Load() {
|
|
t.Fatal("Close() did not record the expected stop")
|
|
}
|
|
}
|
|
|
|
func TestLogInfoWriterEmptyWrite(t *testing.T) {
|
|
n, err := (logInfoWriter{}).Write(nil)
|
|
if n != 0 || err != nil {
|
|
t.Fatalf("empty write: n=%d, err=%v", n, err)
|
|
}
|
|
}
|