mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
Update metadata_version_test.go
This commit is contained in:
@@ -9,29 +9,29 @@ import (
|
||||
|
||||
func TestMetadataVersionComparison(t *testing.T) {
|
||||
// Create handler
|
||||
handler := protocol.NewHandler()
|
||||
|
||||
handler := protocol.NewTestHandler()
|
||||
|
||||
// Add test topic
|
||||
handler.AddTopicForTesting("test-topic", 1)
|
||||
|
||||
|
||||
// Set broker address
|
||||
handler.SetBrokerAddress("127.0.0.1", 9092)
|
||||
|
||||
|
||||
// Test v0 response
|
||||
v0Response, err := handler.HandleMetadataV0(12345, []byte{0, 0}) // empty client_id + empty topics
|
||||
if err != nil {
|
||||
t.Fatalf("v0 error: %v", err)
|
||||
}
|
||||
|
||||
// Test v1 response
|
||||
|
||||
// Test v1 response
|
||||
v1Response, err := handler.HandleMetadataV1(12345, []byte{0, 0}) // empty client_id + empty topics
|
||||
if err != nil {
|
||||
t.Fatalf("v1 error: %v", err)
|
||||
}
|
||||
|
||||
|
||||
fmt.Printf("Metadata v0 response (%d bytes): %x\n", len(v0Response), v0Response)
|
||||
fmt.Printf("Metadata v1 response (%d bytes): %x\n", len(v1Response), v1Response)
|
||||
|
||||
|
||||
// Compare lengths
|
||||
fmt.Printf("Length difference: v1 is %d bytes longer than v0\n", len(v1Response) - len(v0Response))
|
||||
fmt.Printf("Length difference: v1 is %d bytes longer than v0\n", len(v1Response)-len(v0Response))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user