Skip to content

Non-idempotent tests in ExtensionLoaderTest(发现有些单元测试是非幂等的) #6954

@lzx404243

Description

@lzx404243
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

The tests are not idempotent and fails if run twice in the same JVM, because each of the tests pollutes state shared among tests:

  • dubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_replaceExtension_Adaptive
  • dubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_AddExtension
  • dubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_replaceExtension

Environment

  • Dubbo version: Branched from master
  • Operating System version: macOS 10.15.6
  • Java version: 1.8.0_151

Steps to reproduce this issue

  1. Run unit test ExtensionLoaderTest.test_replaceExtension_Adaptive twice in the same JVM.
  2. Run unit test ExtensionLoaderTest.test_AddExtension twice in the same JVM.
  3. Run unit test ExtensionLoaderTest.test_replaceExtension twice in the same JVM.

Expected Result

The tests don't pollute shared states and pass when running twice in the same JVM.

Actual Result

The tests fail when running twice in the same JVM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions