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

TCK Tests for scheduled async methods #439

Closed
8 tasks done
Tracked by #458
KyleAure opened this issue Feb 23, 2024 · 0 comments · Fixed by #442
Closed
8 tasks done
Tracked by #458

TCK Tests for scheduled async methods #439

KyleAure opened this issue Feb 23, 2024 · 0 comments · Fixed by #442
Assignees
Labels

Comments

@KyleAure
Copy link
Contributor

KyleAure commented Feb 23, 2024

Add tests to verify the behavior of a @Schedule which was added to the @Asynchronous annotation in #271

Test Scenarios

  • Execution completion: Ensure scheduled tasks are completed after...
    • future is completed
    • method returns a result (non-null)
    • method returns an exception
  • Execution overlapping:
    • Ensure scheduled execution times that overlap execution that is still running are skipped
  • Executions ignore max-async:
    • Ensure scheduled execution of tasks are not constrained by max-async
  • Multiple schedules:
    • Ensure if multiple schedules are supplied that the next execution time is computed to the closest future.
  • Schedule once:
    • Ensure an empty array of schedules causes a task to be run no more than once.
  • Error cases:
    • Ensure an asynchronous method with a schedule throws a RejectedExecutionException to the caller when supplied with an invalid JNDI name.

Further clarification

Specification states:

If the asynchronous method return type is `void`
and the asynchronous method does not have a schedule, or if the
asynchronous method implementation raises an error or exception, the
Jakarta EE Product Provider completes this instance upon return from the
asynchronous method implementation.

What is the behavior when an asynchronous method return type is void AND the asynchronous method does have a schedule?

  • Does this mean the asynchronous method will run on the schedule until an error is raised?
  • Or should a RejectedExecutionException be thrown to the caller?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant