mirror of
https://github.com/buger/goreplay.git
synced 2026-10-19 16:15:42 +00:00
Improve S3 debugging
This commit is contained in:
@@ -47,7 +47,7 @@ test_all:
|
||||
$(RUN) go test ./... -timeout 120s $(LDFLAGS) $(ARGS) -v
|
||||
|
||||
testone:
|
||||
$(RUN) go test ./... -timeout 4s $(LDFLAGS) -run $(TEST) $(ARGS) -v
|
||||
$(RUN) go test ./. -timeout 60s $(LDFLAGS) -run $(TEST) $(ARGS) -v
|
||||
|
||||
cover:
|
||||
$(RUN) go test $(ARGS) -race -v -timeout 15s -coverprofile=coverage.out
|
||||
|
||||
@@ -41,10 +41,17 @@ func awsConfig() *aws.Config {
|
||||
|
||||
if endpoint := os.Getenv("AWS_ENDPOINT_URL"); endpoint != "" {
|
||||
config.Endpoint = aws.String(endpoint)
|
||||
log.Println("Custom endpoint:", endpoint)
|
||||
}
|
||||
|
||||
log.Println("Connecting to S3. Region: " + region)
|
||||
|
||||
config.CredentialsChainVerboseErrors = aws.Bool(true)
|
||||
|
||||
if os.Getenv("AWS_DEBUG") != "" {
|
||||
config.LogLevel = aws.LogLevel(aws.LogDebugWithHTTPBody)
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -385,7 +385,7 @@ func Duplicate(data []byte) (duplicate []byte) {
|
||||
|
||||
func TestInputFileFromS3(t *testing.T) {
|
||||
rnd := rand.Int63()
|
||||
path := fmt.Sprintf("s3://test-gor/%d/requests.gz", rnd)
|
||||
path := fmt.Sprintf("s3://test-gor-eu/%d/requests.gz", rnd)
|
||||
|
||||
output := NewS3Output(path, &FileOutputConfig{queueLimit: 5000})
|
||||
output.closeC = make(chan struct{}, 10)
|
||||
@@ -404,7 +404,7 @@ func TestInputFileFromS3(t *testing.T) {
|
||||
<-output.closeC
|
||||
}
|
||||
|
||||
input := NewFileInput(fmt.Sprintf("s3://test-gor/%d", rnd), false)
|
||||
input := NewFileInput(fmt.Sprintf("s3://test-gor-eu/%d", rnd), false)
|
||||
|
||||
buf := make([]byte, 1000)
|
||||
for i := 0; i <= 19999; i++ {
|
||||
|
||||
Reference in New Issue
Block a user