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 cloud rate limit #1711

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Test cloud rate limit #1711

merged 2 commits into from
Dec 18, 2024

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Dec 18, 2024

Important

Adds a GitHub Actions workflow and bash script to test API rate limits by sending requests and checking for HTTP 429 responses.

  • Workflow:
    • Adds rate-limit-test.yml to .github/workflows to test API rate limits.
    • Triggers on push and pull request events to the main branch.
  • Script:
    • Adds rateLimit.bash to py/tests to send 60 requests to https://api.cloud.sciphi.ai/v3/health.
    • Expects at least 20 HTTP 429 responses to pass the test.
    • Uses curl to check response codes and logs results with color coding.
    • Handles Ctrl+C to check exit status before termination.

This description was created by Ellipsis for b7345d8. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to b37cd0c in 1 minute and 19 seconds

More details
  • Looked at 82 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. py/tests/rateLimit.bash:4
  • Draft comment:
    Consider allowing the URL to be passed as an argument or environment variable for better flexibility and maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script uses a hardcoded URL, which is not ideal for flexibility and maintainability. It would be better to allow the URL to be passed as an argument or environment variable.
2. py/tests/rateLimit.bash:41
  • Draft comment:
    Consider handling non-200/429 responses more robustly, possibly by logging them for further investigation or implementing a retry mechanism.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script does not handle non-200/429 responses in a meaningful way. It should consider retrying or logging these errors for further investigation.
3. py/tests/rateLimit.bash:31
  • Draft comment:
    Check the exit status of the curl command to handle potential network errors or command failures.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script does not handle the case where the curl command fails (e.g., network issues). It should check for curl's exit status and handle errors appropriately.
4. py/tests/rateLimit.bash:48
  • Draft comment:
    Add a newline at the end of the file for POSIX compliance and to avoid potential issues with some tools.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The script lacks a newline at the end of the file, which is a best practice for POSIX compliance and to avoid potential issues with some tools.

Workflow ID: wflow_8r7aDdIHHA5v7r3z


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on b7345d8 in 18 seconds

More details
  • Looked at 47 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. py/tests/rateLimit.bash:44
  • Draft comment:
    Consider using an adaptive sleep interval based on response codes to better handle rate limits and avoid unnecessary 429 responses.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script uses a fixed sleep interval of 0.05 seconds between requests. This might not be sufficient to avoid hitting rate limits, especially if the server has strict rate limiting policies. A more adaptive approach could be beneficial.
2. py/tests/rateLimit.bash:41
  • Draft comment:
    Consider logging non-200 and non-429 responses for better debugging and analysis of unexpected server behavior.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script does not handle non-200 and non-429 responses in a way that might be useful for debugging or logging purposes. It could be beneficial to log these responses for further analysis.

Workflow ID: wflow_t1ICggfPpSm9yKaF


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 91f503c into main Dec 18, 2024
2 of 3 checks passed
@NolanTrem NolanTrem deleted the Nolan/RateLimitTest branch December 18, 2024 17:55
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.

1 participant