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

chore(e2e): increase test timeout #3103

Merged
merged 2 commits into from
Nov 6, 2024
Merged

chore(e2e): increase test timeout #3103

merged 2 commits into from
Nov 6, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Nov 6, 2024

e2e test runs have been timing out on push to develop, let's bump the default timeout.

Summary by CodeRabbit

  • Bug Fixes
    • Increased the timeout for end-to-end tests from 15 minutes to 20 minutes, allowing for more comprehensive test execution.

Copy link
Contributor

coderabbitai bot commented Nov 6, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request modifies the TestTimeout variable in the cmd/zetae2e/local/local.go file, changing its value from 15 minutes to 20 minutes. This adjustment affects the timeout duration for end-to-end tests executed by the localE2ETest function. No other code changes were made, ensuring that the overall structure and logic of the test execution remain intact.

Changes

File Path Change Summary
cmd/zetae2e/local/local.go Updated TestTimeout from 15 * time.Minute to 20 * time.Minute

Possibly related issues


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.

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: 0

🧹 Outside diff range and nitpick comments (2)
cmd/zetae2e/local/local.go (2)

53-53: LGTM! Consider making the timeout configurable.

The timeout increase from 15 to 20 minutes is reasonable given the comprehensive test suite and complex setup requirements. However, consider making this value configurable via a command-line flag to allow for different timeout durations based on the specific test scenarios being run.

Consider adding a timeout flag:

 var (
-	TestTimeout = 20 * time.Minute
+	defaultTestTimeout = 20 * time.Minute
 )
 
 func NewLocalCmd() *cobra.Command {
     cmd := &cobra.Command{
         Use:   "local",
         Short: "Run Local E2E tests",
         Run:   localE2ETest,
     }
+    cmd.Flags().Duration("timeout", defaultTestTimeout, "timeout duration for the test suite")
     // ... other flags ...

Then update the timer goroutine to use the configured timeout:

-    time.Sleep(TestTimeout)
-    logger.Error("Test timed out after %s", TestTimeout.String())
+    timeout := must(cmd.Flags().GetDuration("timeout"))
+    time.Sleep(timeout)
+    logger.Error("Test timed out after %s", timeout.String())

Line range hint 291-297: Consider implementing test-specific timeouts.

The current implementation uses a global timeout for all test scenarios. Consider implementing test-specific timeouts to better handle varying test durations and improve test reliability.

Consider modifying the test routine functions to accept a context with timeout:

-func erc20TestRoutine(conf *config.Config, runner *runner.Runner, verbose bool, tests ...string) func() error {
+func erc20TestRoutine(ctx context.Context, conf *config.Config, runner *runner.Runner, verbose bool, tests ...string) func() error {
     return func() error {
         logger := runner.NewLogger(verbose, color.FgGreen, "erc20")
+        // Use a shorter timeout for ERC20 tests
+        ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
+        defer cancel()
         // ... test execution ...
     }
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d2e1ffc and baf3fc5.

📒 Files selected for processing (1)
  • cmd/zetae2e/local/local.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
cmd/zetae2e/local/local.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.38%. Comparing base (234dd87) to head (a323411).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3103   +/-   ##
========================================
  Coverage    63.38%   63.38%           
========================================
  Files          422      422           
  Lines        29915    29915           
========================================
  Hits         18963    18963           
  Misses       10111    10111           
  Partials       841      841           

@gartnera gartnera added this pull request to the merge queue Nov 6, 2024
Merged via the queue into develop with commit 9cf3635 Nov 6, 2024
39 checks passed
@gartnera gartnera deleted the bump-e2e-test-timeout branch November 6, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants