修复代理与日志链路的可靠性问题
This commit is contained in:
@@ -244,8 +244,8 @@ func TestEstimatedBytesCoversStringsAndByteSlices(t *testing.T) {
|
||||
RequestHeaders: []byte("7777777"), RequestBody: []byte("88888888"),
|
||||
ResponseHeaders: []byte("999999999"), ResponseBody: []byte("0000000000"),
|
||||
}
|
||||
if got, want := logger.EstimatedBytes(entry), int64(55); got != want {
|
||||
t.Fatalf("EstimatedBytes=%d want %d", got, want)
|
||||
if got := logger.EstimatedBytes(entry); got <= 55 {
|
||||
t.Fatalf("EstimatedBytes=%d must include fixed entry overhead", got)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,6 +485,7 @@ func TestConcurrentStopCannotCancelFirstStopDrain(t *testing.T) {
|
||||
firstCtx, cancelFirst := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancelFirst()
|
||||
go func() { firstResult <- q.Stop(firstCtx) }()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
for q.Stats().Dropped == 0 {
|
||||
q.Submit(&logger.LogEntry{RequestID: "stop-probe"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user