Improve S3 debugging

This commit is contained in:
Leonid Bugaev
2020-06-06 17:07:51 +03:00
parent fa56e7644c
commit ab2ba8400d
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -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
+7
View File
@@ -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
View File
@@ -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++ {