Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .buildkite/scripts/health-report-tests/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def run_logstash(self, full_start_required: bool) -> subprocess.Popen:
for stdout_line in iter(process.stdout.readline, ""):
print(stdout_line.strip())
# we don't wait for Logstash fully start as we also test slow pipeline start scenarios
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is hinting at the fact that the control flow here has implications on polling etc around expectations for LS lifecycle. Perhaps we can be more explicit around what these break statements do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like "we poll stdout until a desired message is encountered, this has implications for how long the logstash process is observed".

When i originally reviewed this (coming from not knowing much about this) it was not clear to be that this has important implications for how long logstash is allowed to run while tests are polling for state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I just saw it.
Right! The current expectation is to validate health observer to catch when pipeline slow start occurs. These break statements are generalized and suit for current scenarios/expectations we want to validate with.
During the slow start scenario, script doesn't show the LS instance logs after knowing it is starting the LS.
As an improvement I can see what we can do is continuous (maybe in a separate thread) showing what is happening with LS instance.

if "Pipeline started" in stdout_line:
if full_start_required is False and "Starting pipeline" in stdout_line:
break
if full_start_required is True and "Pipeline started" in stdout_line:
break
if "Logstash shut down" in stdout_line or "Logstash stopped" in stdout_line:
print(f"Logstash couldn't spin up.")
Expand Down