Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions e2e/vegeta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,14 @@ func processResult(m *methodMetrics, result *vegeta.Result, serviceType serviceT
// Check if Error field is nil (good)
if rpcResponse.Error != nil {
m.jsonRPCErrorField++
// Only track the error field message if there's no validation error
// (to avoid duplicate tracking when validation fails due to error field)
if validationErr == nil {
m.errors[rpcResponse.Error.Message]++
}
}

// Check if Result field is not nil (good)
if rpcResponse.Result == nil {
m.jsonRPCNilResult++
}

// Process validation error
// Process validation error - this takes priority over error field messages
if validationErr != nil {
m.jsonRPCValidateErrors++

Expand All @@ -349,6 +344,13 @@ func processResult(m *methodMetrics, result *vegeta.Result, serviceType serviceT
errorMsg := fmt.Sprintf("JSON-RPC validation error: %v (response preview: %s)", validationErr, preview)
m.jsonRPCValidationErrors[errorMsg]++
m.errors[errorMsg]++
} else if rpcResponse.Error != nil {
// Only track error field message if validation passed
// (meaning the response structure is valid but contains an API error)
// Add response preview to API errors too for consistency - use longer preview for API errors
preview := createResponsePreview(result.Body, 200)
errorMsg := fmt.Sprintf("API error: %s (response preview: %s)", rpcResponse.Error.Message, preview)
m.errors[errorMsg]++
}
}
}
Expand Down Expand Up @@ -706,6 +708,8 @@ func validateResults(t *testing.T, serviceId protocol.ServiceID, m *methodMetric
}
}

// TODO_TECHDEBT(@adshmh): Output the most frequently occurring malformed payloads.

// Collect assertion failures
failures = append(failures, collectHTTPSuccessRateFailures(m, serviceConfig.SuccessRate)...)
failures = append(failures, collectJSONRPCRatesFailures(m, serviceConfig.SuccessRate)...)
Expand Down