Skip to content

Add test for configure and fix flaky tests #855

Open
vshanthe wants to merge 1 commit intodevfrom
int_tests
Open

Add test for configure and fix flaky tests #855
vshanthe wants to merge 1 commit intodevfrom
int_tests

Conversation

@vshanthe
Copy link
Contributor

📝 Description

Test for configure and fix flaky tests

✔️ How to Test

make test-int TEST_CASE=test_account.py
make test-int TEST_CASE=test_clusters.py
make test-int TEST_CASE=test_ssh.py

@vshanthe vshanthe requested a review from a team as a code owner February 13, 2026 12:46
@vshanthe vshanthe requested review from Copilot, ezilber-akamai and yec-akamai and removed request for a team February 13, 2026 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a smoke test for the configure command and fixes flaky integration tests by adding proper retry logic and correcting test assertions. The changes improve test reliability by handling transient SSH connection issues and fixing incorrect header validation in the LKE node view test.

Changes:

  • Added retry logic with 10 attempts for SSH connectivity test to handle transient failures
  • Fixed incorrect header assertions in LKE node view test (split malformed string into proper header list and added missing pool_id)
  • Added smoke test for linode-cli configure --help command

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/integration/ssh/test_ssh.py Added subprocess import, .strip() calls for consistency, and retry logic for flaky SSH connectivity test
tests/integration/lke/test_clusters.py Fixed malformed header list in test_view_node from single concatenated string to proper list with pool_id
tests/integration/account/test_account.py Added smoke test for configure command help output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

]

output = ""
for attempt in range(NUM_OF_RETRIES):
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The loop variable 'attempt' is unused. Consider using '_' to indicate that this variable is intentionally not used, or use 'attempt' in error messages or logging to provide better debugging information.

Suggested change
for attempt in range(NUM_OF_RETRIES):
for _ in range(NUM_OF_RETRIES):

Copilot uses AI. Check for mistakes.
Comment on lines +149 to +160
for attempt in range(NUM_OF_RETRIES):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
if "0% packet loss" in output:
break
time.sleep(10)

assert (
"0% packet loss" in output
), f"Ping failed after {NUM_OF_RETRIES} retries: {output}"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The assertion message includes the output, but doesn't include which attempt failed or any stderr output from the subprocess. Consider including result.stderr in the assertion message to help debug SSH connection failures. The stderr would show SSH errors like connection refused, authentication failures, etc.

Suggested change
for attempt in range(NUM_OF_RETRIES):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
if "0% packet loss" in output:
break
time.sleep(10)
assert (
"0% packet loss" in output
), f"Ping failed after {NUM_OF_RETRIES} retries: {output}"
stderr_output = ""
last_attempt = 0
for attempt in range(NUM_OF_RETRIES):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
stderr_output = result.stderr
last_attempt = attempt + 1
if "0% packet loss" in output:
break
time.sleep(10)
assert (
"0% packet loss" in output
), (
f"Ping failed after {NUM_OF_RETRIES} retries "
f"(last attempt {last_attempt}): stdout: {output}, stderr: {stderr_output}"
)

Copilot uses AI. Check for mistakes.
output = result.stdout
if "0% packet loss" in output:
break
time.sleep(10)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The sleep occurs even after the last retry attempt. Following the pattern in helpers.py (lines 136-137), consider adding a check if attempt < NUM_OF_RETRIES - 1: before the sleep to avoid an unnecessary 10-second delay when all retries are exhausted.

Suggested change
time.sleep(10)
if attempt < NUM_OF_RETRIES - 1:
time.sleep(10)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant