Skip to content

Fix JFR event recorder unit tests #3066 - #3809

Merged
a-TODO-rov merged 1 commit into
redis:mainfrom
lsh1215:3066-jfr-event-recorder-tests
Jun 29, 2026
Merged

a-TODO-rov merged 1 commit into
redis:mainfrom
lsh1215:3066-jfr-event-recorder-tests

Conversation

@lsh1215

@lsh1215 lsh1215 commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3066.

What changed

  • Move JfrEventRecorderUnitTests from src/test/kotlin to src/test/java so the Java unit test is compiled and executed by Surefire.
  • Replace CommandLatencyEvent in shouldNotEmitEventForAbsentJfrEventType with a local event fixture that has no corresponding JFR event type.
  • Remove now-unused imports.

Why

The test was not discovered from its previous location. Once executed, the absent-JFR-type assertion also used a stale fixture because CommandLatencyEvent now has JfrCommandLatencyEvent support.

Verification

  • JAVA_HOME=/Users/leesanghun/Library/Java/JavaVirtualMachines/ms-21.0.10/Contents/Home mvn -Dtest=io.lettuce.core.event.jfr.JfrEventRecorderUnitTests test
  • JAVA_HOME=/Users/leesanghun/Library/Java/JavaVirtualMachines/ms-21.0.10/Contents/Home mvn formatter:format -DskipTests

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Note

Low Risk
Test-only changes with no production code impact.

Overview
Updates shouldNotEmitEventForAbsentJfrEventType so it records a EventWithoutJfrType stub instead of CommandLatencyEvent, which now maps to JFR via JfrCommandLatencyEvent and would make the “no JFR event emitted” assertion wrong.

Cleans up unused imports and tags the test class with UNIT_TEST only.

Reviewed by Cursor Bugbot for commit 7e6ee5c. Bugbot is set up for automated code reviews on this repo. Configure here.

Move the Java unit test into the Java test source tree so Surefire executes it again.

Use a local event fixture without a corresponding JFR event type so the absent-type assertion no longer depends on CommandLatencyEvent coverage.
@lsh1215
lsh1215 marked this pull request as ready for review June 28, 2026 10:09
@a-TODO-rov
a-TODO-rov merged commit 93ec33c into redis:main Jun 29, 2026
20 of 22 checks passed
@lsh1215

lsh1215 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge!

@a-TODO-rov

Copy link
Copy Markdown
Collaborator

My pleasure

a-TODO-rov pushed a commit that referenced this pull request Jul 13, 2026
Move the Java unit test into the Java test source tree so Surefire executes it again.

Use a local event fixture without a corresponding JFR event type so the absent-type assertion no longer depends on CommandLatencyEvent coverage.
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.

Unit test shouldNotEmitEventForAbsentJfrEventType Failed

2 participants

⌂ 换网址