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: more sleep when flow insert makes it serial #4373

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

discord9
Copy link
Contributor

@discord9 discord9 commented Jul 16, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

add more sleep intrinsic in flow's sqlness test, so to make it more serial and prevent getting wrong result by preventing query to happen out of order

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

Summary by CodeRabbit

  • Tests
    • Adjusted the timing of SQL operations for improved test efficiency.
    • Modified sleep durations in SQL scripts from 3 seconds to 2 seconds.
    • Introduced additional 500ms sleep commands to certain SQL queries.

@discord9 discord9 requested a review from a team as a code owner July 16, 2024 02:28
Copy link
Contributor

coderabbitai bot commented Jul 16, 2024

Walkthrough

The modifications across the SQL files primarily adjust the sleep durations in various SQL operations, reducing them from 3 seconds to 2 seconds, and introduce additional 500 milliseconds sleep commands. These changes are aimed at optimizing the timing and execution flow of the SQL scripts.

Changes

Files/Groups Change Summary
tests/cases/standalone/common/flow/basic.sql
tests/cases/standalone/common/flow/df_func.sql
tests/cases/standalone/common/flow/basic.result
tests/cases/standalone/common/flow/df_func.result
Adjusted sleep durations from 3 seconds to 2 seconds. Added new 500 milliseconds sleep commands in various SQL queries.

Poem

In SQL scripts, the sleep did sway,
From three to two, it found its way,
A half-second pause, a gentle nudge,
To speed things up, without a grudge.
The tables turn, with time refined,
A bunny's touch, so well-designed. 🐇💻


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Jul 16, 2024
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 072d7c2 and 7ef64e8.

Files selected for processing (4)
  • tests/cases/standalone/common/flow/basic.result (2 hunks)
  • tests/cases/standalone/common/flow/basic.sql (1 hunks)
  • tests/cases/standalone/common/flow/df_func.result (10 hunks)
  • tests/cases/standalone/common/flow/df_func.sql (4 hunks)
Files skipped from review due to trivial changes (1)
  • tests/cases/standalone/common/flow/df_func.result
Additional comments not posted (8)
tests/cases/standalone/common/flow/basic.sql (2)

13-13: Addition of a new sleep command to ensure serialization.

The addition of a -- SQLNESS SLEEP 500ms command before the INSERT operation is intended to control the timing of data insertion relative to the flow operation, aligning with the PR's objective to make the tests more serial.


22-22: Introduction of additional sleep command for better control over data insertion timing.

Adding another -- SQLNESS SLEEP 500ms command before the subsequent INSERT operation helps in managing the sequence of operations, crucial for achieving the desired test serialization.

tests/cases/standalone/common/flow/basic.result (3)

17-17: Addition of a new sleep command reflected in the results file.

The inclusion of -- SQLNESS SLEEP 500ms in the results file is consistent with the changes made in the .sql file, ensuring that the test expectations align with the actual test setup.


25-25: Updated sleep duration in the results file.

The adjustment of sleep duration from 3 seconds to 2 seconds in the results file matches the change in the .sql file. This consistency is crucial for accurate test validation.


34-34: Consistency in additional sleep command across SQL and result files.

The additional -- SQLNESS SLEEP 500ms command in the results file mirrors the corresponding change in the .sql file, ensuring that the test setup and expectations are synchronized.

tests/cases/standalone/common/flow/df_func.sql (3)

14-14: Introduction of a new sleep command for better serialization control.

The new -- SQLNESS SLEEP 500ms command before data insertion helps manage the timing of operations, aligning with the PR's objective to prevent out-of-order queries.


21-21: Optimization of sleep duration for better test performance.

Reducing the sleep duration to 2 seconds before the SELECT operation is consistent with the changes in other files and helps optimize the test flow without compromising the serialization requirement.


24-24: Additional sleep command to ensure proper data insertion timing.

Adding another -- SQLNESS SLEEP 500ms command before subsequent data insertion is crucial for maintaining the sequence of operations, especially in a testing environment where timing is critical.

@evenyag evenyag changed the title tests: more sleep when flow insert makes it serial test: more sleep when flow insert makes it serial Jul 16, 2024
@evenyag
Copy link
Contributor

evenyag commented Jul 16, 2024

@discord9 I have updated the title to fix the semantic check.

https://github.com/GreptimeTeam/greptimedb/actions/runs/9949757194/job/27486637312?pr=4373
The sqlness test still fails.

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.87%. Comparing base (2b912d9) to head (4e81a34).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4373      +/-   ##
==========================================
- Coverage   85.14%   84.87%   -0.27%     
==========================================
  Files        1068     1074       +6     
  Lines      191512   191831     +319     
==========================================
- Hits       163055   162822     -233     
- Misses      28457    29009     +552     

@evenyag
Copy link
Contributor

evenyag commented Jul 16, 2024

There is also another issue related to flow sqlness test.
#4372

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ef64e8 and 66021c9.

Files selected for processing (2)
  • tests/cases/standalone/common/flow/basic.sql (2 hunks)
  • tests/cases/standalone/common/flow/df_func.sql (8 hunks)
Files skipped from review due to trivial changes (1)
  • tests/cases/standalone/common/flow/basic.sql
Files skipped from review as they are similar to previous changes (1)
  • tests/cases/standalone/common/flow/df_func.sql

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 66021c9 and 4e81a34.

Files selected for processing (2)
  • tests/cases/standalone/common/flow/basic.result (2 hunks)
  • tests/cases/standalone/common/flow/df_func.result (8 hunks)
Additional comments not posted (6)
tests/cases/standalone/common/flow/basic.result (3)

17-17: Introduced sleep command before data insertion.

This change is consistent with the PR's objective to ensure more controlled timing of SQL operations.


34-34: Introduced additional sleep command before data insertion.

This addition helps in managing the sequence of operations, aligning with the aim to make the test more serial.


42-42: Retention of existing sleep command.

Maintaining this delay is crucial for the serial execution of the test, ensuring that operations do not overlap or execute out of order.

tests/cases/standalone/common/flow/df_func.result (3)

18-18: Introduced sleep command before data insertion.

This change helps ensure that data is inserted at a controlled time, aligning with the PR's objective to serialize the test operations.


36-36: Introduced additional sleep command before data insertion.

This addition helps in managing the sequence of operations, aligning with the aim to make the test more serial.


44-44: Retention of existing sleep command.

Maintaining this delay is crucial for the serial execution of the test, ensuring that operations do not overlap or execute out of order.

@discord9 discord9 enabled auto-merge July 16, 2024 03:33
@discord9 discord9 added this pull request to the merge queue Jul 16, 2024
Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

Merged via the queue into GreptimeTeam:main with commit b2c5f8e Jul 16, 2024
55 checks passed
@discord9 discord9 deleted the flow_test_more_sleep branch July 16, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants