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

[Bug] Non-idempotent unit test org.apache.rocketmq.filter.FilterSpiTest#testRegister #8092

Closed
3 tasks done
kaiyaok2 opened this issue May 5, 2024 · 0 comments · Fixed by #8093
Closed
3 tasks done

Comments

@kaiyaok2
Copy link
Contributor

kaiyaok2 commented May 5, 2024

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Ubuntu 22.04

RocketMQ version

Latest commit - af43a3e

JDK Version

JDK 17.0.10

Describe the Bug

The test org.apache.rocketmq.filter.FilterSpiTest#testRegister is non-idempotent (passes in the first run but fails in the second run in the same JVM).

Steps to Reproduce

Use the NIOInspector plugin that supports rerunning unit tests in the same JVM:

cd filter
mvn edu.illinois:NIODetector:rerun -Dtest=org.apache.rocketmq.filter.FilterSpiTest#testRegister

It can be seen that the test passes in the first run but fails in the second run in the same JVM.

What Did You Expect to See?

The test shall pass in repeated execution in the same environment.

What Did You See Instead?

The following error is raised in the second execution:

java.lang.IllegalArgumentException: Filter spi type(Nothing) already exist!
	at org.apache.rocketmq.filter.FilterFactory.register(FilterFactory.java:44)
	at org.apache.rocketmq.filter.FilterSpiTest.testRegister(FilterSpiTest.java:53)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

Additional Context

No response

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 a pull request may close this issue.

1 participant