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

Bugfix: Fix flaky e2e test - instructor edits a channel #9922

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

muradium
Copy link
Contributor

@muradium muradium commented Dec 1, 2024

Checklist

General

Client

Motivation and Context

"Instructor should be able to edit a channel" test is flaky and sometimes fails on multi-node build plan. The reason is the header of conversation page sometimes loading longer than expected.

Description

This PR adds a waiting for the header of conversation page with additional timeout - 10 seconds (instead of default 5 seconds) and starts asserting its elements only after it's loaded and visible to user.

Steps for Testing

  • Code Review: Ensure that test passes for valid reasons and improvements make sense.
  • CI testing: Check that all tests pass on both single-node and multi-node Artemis Bamboo builds.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of channel editing tests by adding a wait condition for the visibility of the conversation header, addressing potential timing issues.
  • Tests

    • Enhanced the robustness of the test suite without altering existing test logic or flow.

Copy link

coderabbitai bot commented Dec 1, 2024

Walkthrough

The pull request introduces a modification to the CourseMessages.spec.ts file, enhancing the channel editing functionality within the course messaging system. A wait condition is added to ensure the visibility of the conversation header after an edit operation, improving the reliability of the test by addressing timing issues during page reloads. The overall structure and logic of the test cases remain unchanged, with no new tests introduced.

Changes

File Path Change Summary
src/test/playwright/e2e/course/CourseMessages.spec.ts Added a wait condition for the visibility of the conversation header after editing a channel. No other changes to existing logic or structure.

Possibly related PRs

Suggested labels

tests, bugfix, playwright, ready for review

Suggested reviewers

  • SimonEntholzer
  • krusche
  • florian-glombik
  • edkaya
  • az108

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 or @coderabbitai title 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

@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 (1)
src/test/playwright/e2e/course/CourseMessages.spec.ts (1)

151-151: Consider these improvements for better maintainability.

While the current implementation works, consider these enhancements:

  1. Extract the timeout value to a constant for easier maintenance
  2. Add a custom error message for better debugging
  3. Use a more specific selector if possible
+ // At the top of the file with other constants
+ const HEADER_VISIBILITY_TIMEOUT = 10000;

- await page.locator('jhi-conversation-header').waitFor({ state: 'visible', timeout: 10000 });
+ await page.locator('jhi-conversation-header').waitFor({
+   state: 'visible',
+   timeout: HEADER_VISIBILITY_TIMEOUT,
+   message: 'Conversation header did not become visible within 10 seconds'
+ });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between dece904 and a7b2741.

📒 Files selected for processing (1)
  • src/test/playwright/e2e/course/CourseMessages.spec.ts (1 hunks)
🔇 Additional comments (1)
src/test/playwright/e2e/course/CourseMessages.spec.ts (1)

151-151: LGTM! The wait condition addresses the flaky test issue.

The added wait condition ensures the conversation header is visible before proceeding with assertions, which should resolve the flaky behavior in multi-node environments.

Copy link

github-actions bot commented Dec 1, 2024

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test3.artemis.cit.tum.de" is already in use by PR #9558.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment-error Added by deployment workflows if an error occured ready for review
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

2 participants