Skip to content

Fix stress-ng source clone timeout - #4683

Open
Vivek Yadav (vyadavmsft) wants to merge 1 commit into
mainfrom
vyadav/fix-stress-ng-clone-timeout
Open

Fix stress-ng source clone timeout#4683
Vivek Yadav (vyadavmsft) wants to merge 1 commit into
mainfrom
vyadav/fix-stress-ng-clone-timeout

Conversation

@vyadavmsft

Copy link
Copy Markdown
Collaborator

Add an opt-in shallow mode to the shared Git clone helper and use it for the pinned stress-ng release. This avoids downloading unnecessary repository history during the source-install fallback while preserving existing clone behavior for other callers.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 an opt-in “shallow clone” mode to LISA’s shared Git.clone() helper and uses it for the pinned stress-ng source-install fallback to reduce clone time and avoid timeouts caused by downloading unnecessary history.

Changes:

  • Extend lisa.tools.git.Git.clone() with a shallow: bool = False parameter that adds --depth 1 (and --branch when ref is provided).
  • Use shallow=True when cloning the pinned stress-ng release during _install_from_src().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lisa/tools/stress_ng.py Uses shallow cloning for the pinned stress-ng source install path.
lisa/tools/git.py Adds an opt-in shallow clone option to reduce clone time/history download.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lisa/tools/git.py
Copilot AI review requested due to automatic review settings August 19, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

lisa/tools/git.py:72

  • When shallow=True, the code unconditionally maps any non-empty ref to git clone --branch <ref>. --branch only works for branch/tag names; it fails for commit SHAs and refspecs like refs/pull/.../merge (which checkout() explicitly supports via fetch origin <ref>). Consider only adding --branch for simple branch/tag refs, and letting checkout() handle other ref types.
        cmd = f"clone {auth_flag} {url} {dir_name} --recurse-submodules"
        if shallow:
            cmd += " --depth 1"
            if ref:
                cmd += f" --branch {ref}"

Copilot AI review requested due to automatic review settings August 19, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

lisa/tools/git.py:71

  • Minor/performance: shallow=True adds --depth 1, but with --recurse-submodules Git will still fetch full submodule history unless --shallow-submodules is also set. Adding it makes the shallow option actually reduce clone time for repos with submodules.
            cmd += " --depth 1"

lisa/tools/stress_ng.py:45

  • Minor: _check_exists() runs a constant command via node.execute(..., shell=True). Using Tool.run() (with shell=False) avoids unnecessary shell parsing and keeps execution consistent with other Tool invocations.
        result = self.node.execute(
            f"{self.command} --version",
            shell=True,
            sudo=self._use_sudo,
            no_error_log=True,

Copilot AI review requested due to automatic review settings August 19, 2026 22:33
@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Result: Canceled

View full logs in Azure DevOps

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

lisa/tools/stress_ng.py:60

  • This debug message says the installed version is older than self.branch (a tag like V0.22.00), but the actual comparison is against _minimum_safe_version (e.g. 0.22.0). This can be confusing when troubleshooting version-related rebuilds.
        if installed_version < self._minimum_safe_version:
            self._log.debug(
                f"installed {self.command} version is older than "
                f"{self.branch}; installing a fixed build from source"
            )

lisa/tools/git.py:72

  • When shallow=True, this adds --branch {ref}. That works for branch/tag names, but it breaks callers that pass a commit SHA or a non-branch ref like refs/pull/..., which the existing clone(..., ref=...) contract supports via the later checkout(ref) fetch fallback. Guard --branch so shallow clones still work with commit/PR refs.
        if shallow:
            cmd += " --depth 1"
            if ref:
                cmd += f" --branch {ref}"

Comment thread lisa/tools/stress_ng.py
@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add

Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest

Result: Succeeded

View full logs in Azure DevOps

Comment thread lisa/tools/git.py
if shallow:
cmd += " --depth 1"
if ref:
cmd += f" --branch {ref}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ref has been handled in

if ref:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The later checkout(ref) handles post-clone setup, but --branch ensures the requested tag is included in the depth-1 clone. Without it, resolving V0.22.00 through the fallback fetch downloads full history and recreates the timeout. I added a comment clarifying the distinction.

Use a shallow clone of the pinned V0.22.00 release so source fallback completes within the tool timeout.

Reject installed stress-ng versions older than 0.22.0 and rebuild them from source. This release validates exposed AVX-512 features before selecting target-cloned code, preventing SIGILL on virtualized guests.
Copilot AI review requested due to automatic review settings August 20, 2026 21:05
@vyadavmsft
Vivek Yadav (vyadavmsft) force-pushed the vyadav/fix-stress-ng-clone-timeout branch from 8676fa0 to 4d64a42 Compare August 20, 2026 21:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

lisa/tools/stress_ng.py:48

  • Major: str.removeprefix() requires Python 3.9+, but the project supports Python >=3.8 (per pyproject.toml). This will raise AttributeError on Python 3.8 when checking the installed stress-ng version.
            installed_version = parse_version(
                result.stdout.strip().removeprefix("stress-ng, version ")
            )

@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add

Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest

Result: Succeeded

View full logs in Azure DevOps

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.

3 participants