-
Notifications
You must be signed in to change notification settings - Fork 1.9k
INFOPLAT-2875: Beholder logs streaming test in CRE #20131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
5eec63b to
793d1e6
Compare
81f9094 to
135d4bd
Compare
| testLogger.Info().Msg("Starting Log Streaming Test") | ||
|
|
||
| testLogger.Info().Msg("Waiting for logs to accumulate...") | ||
| time.Sleep(60 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the safe wait time, to wait for logs to accumulate from chainlink nodes to loki through beholder and OTel collector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every hard coded sleep like that 1. increases the overall testing wait time by at least one minutes, and 2. is prone to flakiness once the underlying code may exceed one minute deadline. Would you be able to switch to "require.Eventually" with periodic polling here? (the advantage is that you can introduce periodic polling with t.Deadline() and avoid hard coded deadlines)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good advice, replaced
| q.Set("limit", "10") | ||
| u.RawQuery = q.Encode() | ||
|
|
||
| req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, u.String(), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please propagate testing.T.context() here
…min timeout reached.
| return false | ||
| } | ||
| return beholderLogsCount > 0 | ||
| }, 5*time.Minute, 5*time.Second, "Expected to find logs with beholder_data_type=zap_log_message in Loki within timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|





This PR introduces Beholder logs streaming test in CRE. We leverage local CRE environment with CTF observability framework. The test is suppose to validate if logs with
beholder_data_type=zap_log_messageare sent from chainlink nodes to observability stack (OTel collector) and Loki.Related to: #19089