fix tests

This commit is contained in:
chrislu
2025-09-14 10:52:23 -07:00
parent 881a418b95
commit 4e11a378fd
7 changed files with 19 additions and 23 deletions
+11 -11
View File
@@ -27,7 +27,7 @@ jobs:
matrix:
container-id: [unit-tests-1]
container:
image: golang:1.21-alpine
image: golang:1.24-alpine
options: --cpus 1.0 --memory 1g --hostname kafka-unit-${{ matrix.container-id }}
env:
GOMAXPROCS: 1
@@ -37,7 +37,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
@@ -59,7 +59,7 @@ jobs:
# Set process limits for container isolation
ulimit -n 512
ulimit -u 100
go test -v -timeout 10s -run "^Test" -skip "KafkaGateway_APISequence|KafkaGoClient_BasicProduceConsume|KafkaGoClient_ConsumerGroups|KafkaGoClient_OffsetManagement|Sarama" ./...
go test -v -timeout 10s -run "^Test" -skip "KafkaGateway_APISequence|KafkaGoClient_BasicProduceConsume|KafkaGoClient_ConsumerGroups|KafkaGoClient_OffsetManagement|TestOffsetManagement|Sarama" ./...
kafka-integration-tests:
name: Kafka Integration Tests (Critical)
@@ -70,7 +70,7 @@ jobs:
matrix:
container-id: [integration-1]
container:
image: golang:1.21-alpine
image: golang:1.24-alpine
options: --cpus 2.0 --memory 2g --ulimit nofile=1024:1024 --hostname kafka-integration-${{ matrix.container-id }}
env:
GOMAXPROCS: 2
@@ -81,7 +81,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
@@ -129,7 +129,7 @@ jobs:
matrix:
container-id: [consumer-group-1]
container:
image: golang:1.21-alpine
image: golang:1.24-alpine
options: --cpus 1.0 --memory 2g --ulimit nofile=512:512 --hostname kafka-consumer-${{ matrix.container-id }}
env:
GOMAXPROCS: 1
@@ -140,7 +140,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
@@ -185,7 +185,7 @@ jobs:
matrix:
container-id: [client-compat-1]
container:
image: golang:1.21-alpine
image: golang:1.24-alpine
options: --cpus 1.0 --memory 1.5g --shm-size 256m --hostname kafka-client-${{ matrix.container-id }}
env:
GOMAXPROCS: 1
@@ -196,7 +196,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
@@ -236,7 +236,7 @@ jobs:
matrix:
container-id: [protocol-1]
container:
image: golang:1.21-alpine
image: golang:1.24-alpine
options: --cpus 1.0 --memory 1g --tmpfs /tmp --hostname kafka-protocol-${{ matrix.container-id }}
env:
GOMAXPROCS: 1
@@ -247,7 +247,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
go-version: ^1.24
id: go
- name: Check out code
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine AS builder
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
+1 -1
View File
@@ -232,7 +232,7 @@ jobs:
### Docker Testing
```dockerfile
FROM golang:1.21
FROM golang:1.24
RUN apt-get update && apt-get install -y fuse
COPY . /seaweedfs
WORKDIR /seaweedfs
+1 -1
View File
@@ -1,5 +1,5 @@
# Dockerfile for Kafka Integration Test Setup
FROM golang:1.21-alpine AS builder
FROM golang:1.24-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git make gcc musl-dev
+4 -3
View File
@@ -1,6 +1,7 @@
package protocol
import (
"context"
"encoding/binary"
"testing"
"time"
@@ -67,7 +68,7 @@ func TestHandler_handleFetch(t *testing.T) {
requestBody = append(requestBody, 0, 0, 0, 0, 0, 0, 0, 0) // log start offset
requestBody = append(requestBody, 0, 0, 0x10, 0) // partition max bytes (1MB)
response, err := h.handleFetch(correlationID, 7, requestBody)
response, err := h.handleFetch(context.Background(), correlationID, 7, requestBody)
if err != nil {
t.Fatalf("handleFetch: %v", err)
}
@@ -196,7 +197,7 @@ func TestHandler_handleFetch_UnknownTopic(t *testing.T) {
requestBody = append(requestBody, 0, 0, 0, 0, 0, 0, 0, 0) // log start offset
requestBody = append(requestBody, 0, 0, 0x10, 0) // partition max bytes
response, err := h.handleFetch(correlationID, 7, requestBody)
response, err := h.handleFetch(context.Background(), correlationID, 7, requestBody)
if err != nil {
t.Fatalf("handleFetch: %v", err)
}
@@ -254,7 +255,7 @@ func TestHandler_handleFetch_EmptyPartition(t *testing.T) {
requestBody = append(requestBody, 0, 0, 0, 0, 0, 0, 0, 0) // log start offset
requestBody = append(requestBody, 0, 0, 0x10, 0) // partition max bytes
response, err := h.handleFetch(correlationID, 7, requestBody)
response, err := h.handleFetch(context.Background(), correlationID, 7, requestBody)
if err != nil {
t.Fatalf("handleFetch: %v", err)
}
@@ -647,11 +647,6 @@ func (h *Handler) buildOffsetFetchResponse(response OffsetFetchResponse, apiVers
binary.BigEndian.PutUint16(groupErrorBytes, uint16(response.ErrorCode))
result = append(result, groupErrorBytes...)
// Throttle time (4 bytes) - only included in version 3+
if apiVersion >= 3 {
result = append(result, 0, 0, 0, 0)
}
return result
}