Skip to content

[12.x] Add some tests coverage for Queue Exception handling #55442

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

Conversation

roshandelpoor
Copy link
Contributor

This PR enhances the test coverage for queue exception handling by adding several new test cases to QueueExceptionTest.php. The additions provide more thorough testing of exception behavior and edge cases.

  • test_timeout_exception_can_be_converted_to_string:
    Tests that the TimeoutExceededException can be properly converted to a string representation.
  • test_max_attempts_exception_can_be_converted_to_string:
    Tests that the MaxAttemptsExceededException can be properly converted to a string representation.
  • test_exceptions_preserve_job_instance:
    Verifies that both exception types properly preserve and expose the job instance that caused the exception, and confirms the type safety of the job property.
  • test_custom_job_name_resolution:
    Tests the exception behavior with a custom job name by using an anonymous class that extends MyFakeRedisJob with a different name resolution.

Benefits:

  • Increased test coverage for queue exception handling
  • Better validation of exception message formatting
  • Improved verification of job instance handling
  • Added coverage for custom job name scenarios

@taylorotwell
Copy link
Member

I think it's OK. Some of these tests just feel a bit like noise.

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.

2 participants