Allow some blockhound block methods

- Looks like some tests fails with redis
  as new lettuse driver, during connect phase,
  will block as there's a timeout which cause
  a block within netty internals(which a bit weird).
- Time of this commit block error came from
  https://github.com/netty/netty/blame/4.1/common/src/main/java/io/netty/util/HashedWheelTimer.java#L349
This commit is contained in:
Janne Valkealahti
2020-10-31 14:51:50 +00:00
parent 7963c24d8c
commit 3d2e1de237
4 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.statemachine.buildtests;
import reactor.blockhound.BlockHound.Builder;
import reactor.blockhound.integration.BlockHoundIntegration;
public class StateMachineBlockHoundIntegration implements BlockHoundIntegration {
@Override
public void applyTo(Builder builder) {
// whitelisting some blocking calls in tests
builder
.allowBlockingCallsInside("java.util.concurrent.locks.AbstractQueuedSynchronizer", "parkAndCheckInterrupt");
}
}

View File

@@ -0,0 +1 @@
org.springframework.statemachine.buildtests.StateMachineBlockHoundIntegration

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.statemachine.data.redis;
import reactor.blockhound.BlockHound.Builder;
import reactor.blockhound.integration.BlockHoundIntegration;
public class StateMachineBlockHoundIntegration implements BlockHoundIntegration {
@Override
public void applyTo(Builder builder) {
// whitelisting some blocking calls in tests
builder
.allowBlockingCallsInside("java.util.concurrent.locks.AbstractQueuedSynchronizer", "parkAndCheckInterrupt");
}
}

View File

@@ -0,0 +1 @@
org.springframework.statemachine.data.redis.StateMachineBlockHoundIntegration