Skip to content

Commit b15429a

Browse files
committed
Fix integration test
1 parent 0ff33c3 commit b15429a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

testing/integration/ess/beat_receivers_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,22 +854,24 @@ agent.monitoring.enabled: false
854854
logsBytes, err := fixture.Exec(ctx, []string{"logs", "-n", "1000"})
855855

856856
// verify we've logged a warning about using the process runtime
857-
var logRecord map[string]any
857+
var unsupportedLogRecord map[string]any
858858
for _, line := range strings.Split(string(logsBytes), "\n") {
859859
line = strings.TrimSpace(line)
860860
if line == "" {
861861
continue
862862
}
863+
var logRecord map[string]any
863864
if unmarshalErr := json.Unmarshal([]byte(line), &logRecord); unmarshalErr != nil {
864865
continue
865866
}
866867

867-
if message, ok := logRecord["message"].(string); !ok || !strings.HasPrefix(message, "otel runtime is not supported") {
868-
continue
868+
if message, ok := logRecord["message"].(string); ok && !strings.HasPrefix(message, "otel runtime is not supported") {
869+
unsupportedLogRecord = logRecord
870+
break
869871
}
870872
}
871-
assert.NotNil(t, logRecord)
872-
message, ok := logRecord["message"].(string)
873+
assert.NotNil(t, unsupportedLogRecord)
874+
message, ok := unsupportedLogRecord["message"].(string)
873875
require.True(t, ok)
874876
expectedMessage := "otel runtime is not supported for component system/metrics-default, switching to process runtime, reason: unsupported configuration for system/metrics-default: error translating config for output: default, unit: system/metrics-default, error: allow_older_versions:false is currently not supported: unsupported operation"
875877
assert.Equal(t, expectedMessage, message)

0 commit comments

Comments
 (0)