feat: publish v1.0.0-rc.36-custom.1
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 9m20s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 55m7s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 9m20s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 55m7s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
This commit is contained in:
commit
bb7968b612
2381 files changed
+551494
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/QuantumNous/new-api/model"
|
||||
relaycommon "github.com/QuantumNous/new-api/relay/common"
|
||||
)
|
||||
|
||||
func TestAppendStreamStatusTreatsClientGoneAsDisplayNormal(t *testing.T) {
|
||||
status := relaycommon.NewStreamStatus()
|
||||
status.SetEndReason(relaycommon.StreamEndReasonClientGone, nil)
|
||||
info := &relaycommon.RelayInfo{IsStream: true, StreamStatus: status}
|
||||
other := model.NewLogOther()
|
||||
|
||||
appendStreamStatus(info, other)
|
||||
|
||||
streamInfo, ok := other.Snapshot()["stream_status"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatal("stream_status was not written")
|
||||
}
|
||||
if got := streamInfo["status"]; got != "ok" {
|
||||
t.Fatalf("expected client_gone display status ok, got %v", got)
|
||||
}
|
||||
if got := streamInfo["end_reason"]; got != string(relaycommon.StreamEndReasonClientGone) {
|
||||
t.Fatalf("expected client_gone end reason to be retained, got %v", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user