Skip to content
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

test: fix e2e tests so they pass locally #2054

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MaanavKhaitan
Copy link

@MaanavKhaitan MaanavKhaitan commented Oct 8, 2024

Why

e2e tests were not passing when run locally using make test-e2e. Was running into CPU and memory limits and the besu validator was causing flaky tests.

What

  • Reduces the CPU and memory minimums for blutgang to 0
  • Reduces MinMemory for execution nodes to 0
  • Removes besu validator from list of default validators in e2e config

Testing

make test-e2e: Passes locally

image

Summary by CodeRabbit

  • New Features

    • Adjusted resource allocation parameters allowing for no minimum CPU and memory requirements for services.
    • Updated testing configuration to exclude the "besu" node type from the validator setup.
  • Bug Fixes

    • Resolved issues with flaky tests by modifying the "besu" node's configuration.
  • Documentation

    • Updated configuration settings to reflect changes in resource management and testing setups.

Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

Walkthrough

The pull request introduces changes to resource allocation parameters in two files: kurtosis/src/services/blutgang/launcher.star and testing/e2e/config/config.go. In launcher.star, the minimum CPU and memory values are set to 0, allowing for no minimum resource allocation. In config.go, the "besu" node type's replicas are reduced to 0, and the minimum memory requirement is also set to 0. These changes affect how the services and testing configurations manage resources.

Changes

File Path Change Summary
kurtosis/src/services/blutgang/launcher.star Updated MIN_CPU to 0 and MIN_MEMORY to 0, allowing no minimum resource allocation.
testing/e2e/config/config.go Changed Replicas for "besu" from 1 to 0 and MinMemory from 1024 to 0 in testing settings.

Possibly related PRs

Suggested reviewers

  • ocnc
  • itsdevbear

Poem

In the land of code where bunnies hop,
We’ve trimmed down limits, let resources drop.
With CPUs and memory set to none,
Our services dance, oh what fun!
Testing's now lighter, no more heavy load,
Hooray for the changes, let’s hit the road! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range comments (1)
testing/e2e/config/config.go (1)

Line range hint 1-370: Summary: Improvements to e2e test configuration

The changes made in this file directly address the PR objectives:

  1. Removing the Besu validator from the default configuration should help reduce flaky tests.
  2. Setting MinMemory to 0 for execution nodes allows for more flexible resource allocation, which can help with running tests on machines with limited resources.

These modifications should improve the stability and flexibility of e2e tests, especially when run locally. However, it's important to monitor the impact of these changes, particularly the MinMemory setting, to ensure they don't introduce new stability issues.

Consider implementing a monitoring system or expanding logging to track memory usage of execution nodes during e2e tests. This will help validate that the new configuration doesn't lead to under-allocation of resources in various test environments.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 1c0a378 and db43629.

📒 Files selected for processing (2)
  • kurtosis/src/services/blutgang/launcher.star (1 hunks)
  • testing/e2e/config/config.go (2 hunks)
🧰 Additional context used
🔇 Additional comments (3)
kurtosis/src/services/blutgang/launcher.star (2)

19-19: Approved: MIN_MEMORY reduction aligns with PR objectives, but requires careful monitoring.

The change from 1024 to 0 for MIN_MEMORY allows the 'blutgang' component to run with no minimum memory allocation, which aligns with the PR objective to reduce resource requirements for local e2e tests.

To ensure this change doesn't lead to out-of-memory errors, especially in production environments, consider implementing the following:

  1. Add logging or monitoring for memory usage.
  2. Implement safeguards to prevent complete memory exhaustion.

Run the following script to check for any existing memory management or monitoring code:

#!/bin/bash
# Description: Check for memory management or monitoring code

# Test 1: Search for memory-related logging or monitoring
rg --type=go --type=python --type=rust -i '(log|monitor).*memory'

# Test 2: Check for memory management libraries or imports
rg --type=go --type=python --type=rust -i '(import|use).*memory'

17-17: Approved: MIN_CPU reduction aligns with PR objectives.

The change from 1000 to 0 for MIN_CPU allows the 'blutgang' component to run with no minimum CPU allocation, which aligns with the PR objective to reduce resource requirements for local e2e tests.

To ensure this change doesn't negatively impact performance in production environments, consider running the following script to check for any performance-related configurations or documentation:

✅ Verification successful

MIN_CPU reduction verified across configurations.

The change aligns with existing resource configurations in kurtosis/beaconkit-all.yaml, ensuring consistent CPU allocation parameters across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for performance-related configurations or documentation

# Test 1: Search for performance-related comments or configurations
rg --type=toml --type=yaml --type=md -i '(cpu|performance|resource)'

# Test 2: Check if there's any documentation about resource requirements
fd -e md | xargs rg -i '(minimum|recommended).*\s(cpu|resource)'

Length of output: 347


Script:

#!/bin/bash
# Description: Check for performance-related configurations or documentation

# Test 1: Search for performance-related comments or configurations
rg --type=toml --type=yaml --type=md -i '(cpu|performance|resource)'

# Test 2: Check if there's any documentation about resource requirements
fd -e md | xargs rg -i '(minimum|recommended).*\s(cpu|resource)'

Length of output: 833


Script:

#!/bin/bash
# Description: Check for performance-related configurations or documentation

# Test 1: Search for performance-related comments or configurations
rg --type=toml --type=yaml --type=md -i '(cpu|performance|resource)'

# Test 2: Check if there's any documentation about resource requirements
fd -e md | xargs rg -i '(minimum|recommended)\s+(cpu|resource)'

Length of output: 832

testing/e2e/config/config.go (1)

270-270: 🧹 Nitpick (assertive)

Approved: Lowering MinMemory for execution nodes, but consider adding a comment

The change to set MinMemory: 0 for execution nodes aligns with the PR objective and should help with running tests on machines with limited resources. This flexibility in resource allocation is beneficial for local test environments.

Consider adding a comment to explain the rationale behind setting MinMemory to 0:

MinMemory: 0, // Set to 0 to allow flexible allocation in resource-constrained environments

It's important to ensure that setting MinMemory to 0 doesn't lead to stability issues due to insufficient memory allocation. Please monitor the impact of this change on test stability and performance. If you have any automated memory usage tracking or logging in place, it would be beneficial to verify that the execution nodes are still getting sufficient memory allocated.

kurtosis/src/services/blutgang/launcher.star Show resolved Hide resolved
testing/e2e/config/config.go Show resolved Hide resolved
@nidhi-singh02
Copy link
Contributor

Thanks for the PR! @MaanavKhaitan Wanted to know how does your machine configuration looks like in case of memory.

@MaanavKhaitan
Copy link
Author

MaanavKhaitan commented Oct 14, 2024

@nidhi-singh02 I'm running an M1 pro mac with 12GB of memory

@MaanavKhaitan
Copy link
Author

MaanavKhaitan commented Oct 14, 2024

I'm working on adding a IS_CI flag to Kurtosis, which will use 1024 for MIN_CPU and MIN_MEMORY if the flag is set to true. I'll also add a CI config.

Will try to get this done by today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants