-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: correctly set error code in the debug mode #198
Conversation
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
WalkthroughThis update introduces a series of enhancements and bug fixes across the project. Key changes include improved error handling in Go code, the addition of a new test configuration for addressing a specific bug scenario, and updates to test cases to align with new configurations and address specific bugs. The changes aim to refine the project's robustness, particularly in error handling and testing, ensuring more accurate responses and behaviors under error conditions. Changes
Assessment against linked issues
Related issues
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (8)
go.work.sum
is excluded by:!**/*.sum
tests/go.mod
is excluded by:!**/*.mod
tests/go.sum
is excluded by:!**/*.sum
tests/test-certs/localhost+2-client-key.pem
is excluded by:!**/*.pem
tests/test-certs/localhost+2-client.pem
is excluded by:!**/*.pem
tests/test-certs/localhost+2-key.pem
is excluded by:!**/*.pem
tests/test-certs/localhost+2.pem
is excluded by:!**/*.pem
tests/test-certs/rootCA.pem
is excluded by:!**/*.pem
Files selected for processing (7)
- .gitignore (1 hunks)
- handler/handler.go (1 hunks)
- tests/configs/.rr-bug1843.yaml (1 hunks)
- tests/handler_test.go (1 hunks)
- tests/http_plugin3_test.go (2 hunks)
- tests/http_plugin4_test.go (1 hunks)
- tests/php_test_files/bug1843.php (1 hunks)
Additional comments: 8
tests/php_test_files/bug1843.php (1)
- 1-2: The PHP script immediately throws an exception, which is intended for testing the server's error handling before the PSR7 worker is initialized. This approach is effective for simulating early script failures.
.gitignore (1)
- 19-19: Adding
**/tests/test_certs/**
to.gitignore
is a good practice to prevent test certificates from being tracked in version control, enhancing security.tests/configs/.rr-bug1843.yaml (1)
- 1-20: The configuration file is correctly set up to replicate the issue described in #1843, with appropriate server and HTTP settings for testing. This ensures the test environment is isolated and controlled.
tests/http_plugin4_test.go (1)
- 96-178: The test function
TestBug1843
is well-structured, making an HTTP request to trigger the error condition and asserting the expected 500 status code and error message. This effectively validates the fix for the reported issue.handler/handler.go (1)
- 214-225: Refactoring
handleError
to write an internal server error and set a special header if there are no free workers is a good improvement. Including the error message in the response when in debug mode is helpful for debugging.tests/http_plugin3_test.go (2)
- 505-505: Updating the version in the
config.Plugin
struct to "2023.3.1" aligns with the project's versioning scheme and ensures the test uses the correct configuration.- 611-617: Adding a delay before reading the directory contents and using
assert.NotContains
to check for file names is a more robust way to ensure temporary files are cleaned up after multipart form tests.tests/handler_test.go (1)
- 1463-1463: The server address in
TestHandler_Multipart_PATCH
was updated to:34432
. Ensure this port is not used elsewhere in the tests or application to avoid conflicts.Verification successful
The search for the usage of port
34432
within the codebase has returned only one occurrence, which is in the filetests/handler_test.go
as specified in the review comment. This indicates that the port34432
is not used elsewhere in the tests or application, thus avoiding potential conflicts.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for the usage of port 34432 to ensure no conflicts. rg ":34432"Length of output: 117
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (3)
go.work.sum
is excluded by:!**/*.sum
tests/go.mod
is excluded by:!**/*.mod
tests/go.sum
is excluded by:!**/*.sum
Files selected for processing (2)
- .github/workflows/linux.yml (2 hunks)
- tests/http_plugin4_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- tests/http_plugin4_test.go
Additional comments: 2
.github/workflows/linux.yml (2)
- 20-20: PHP version updated to 8.3 in the CI pipeline. This change ensures compatibility with the latest PHP version.
- 80-80: Added a step to create a
test-certs
directory and populate it with SSL certificates. This is essential for HTTPS tests, ensuring the CI environment is correctly set up for security testing.
Reason for This PR
closes: roadrunner-server/roadrunner#1843
Description of Changes
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
.gitignore
to exclude specific test certificates.\RuntimeException
.