zrlw opened a new issue #383: URL: https://github.com/apache/dubbo-samples/issues/383
对于master分支而言,很多类都有static boolean类型的destroyed成员,这些成员在destroy之后会被设置为true,如果不重置为false,将会影响下一个测试类。 比如: ``` 2021-10-25T08:02:51.1761445Z Running org.apache.dubbo.samples.version.VersionService2IT 2021-10-25T08:02:51.2184675Z [25/10/21 08:02:44:044 UTC] main INFO support.AbstractRegistryFactory: [DUBBO] Close all registries [zookeeper://zookeeper:2181/org.apache.dubbo.registry.RegistryService?application=version-consumer-1&dubbo=2.0.2&id=org.apache.dubbo.config.RegistryConfig&interface=org.apache.dubbo.registry.RegistryService&pid=19&release=2.7.14-SNAPSHOT×tamp=1635148963028], dubbo version: 2.7.14-SNAPSHOT, current host: 192.168.128.5 <== VersionService2IT结束时把AbstractRegistryFactory的destroyed标志置为了true 2021-10-25T08:02:51.2262094Z Running org.apache.dubbo.samples.version.VersionService1IT <== 开始VersionService1IT 2021-10-25T08:02:51.2442794Z [25/10/21 08:02:45:045 UTC] main WARN support.AbstractRegistryFactory: [DUBBO] All registry instances have been destroyed, failed to fetch any instance. Usually, this means no need to try to do unnecessary redundant resource clearance, all registries has been taken care of., dubbo version: 2.7.14-SNAPSHOT, current host: 192.168.128.5 <== 因为AbstractRegistryFactory的destroyed标志没有重置,所以还是true,导致没有创建新的注册对象,触发后续代码异常 2021-10-25T08:02:51.2446548Z [25/10/21 08:02:45:045 UTC] main ERROR context.TestContextManager: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1e34c607] to prepare test instance [org.apache.dubbo.samples.version.VersionService1IT@251ebf23] 2021-10-25T08:02:51.2455671Z org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.dubbo.samples.version.VersionService1IT': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'versionService': ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
