You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "kirklund (GitHub)" <gi...@apache.org> on 2018/11/09 19:05:19 UTC

[GitHub] [geode] kirklund commented on pull request #2819: GEODE-6013: Made changes to use the expected initial image requester's rvv information

beforeProcessMessage is invoked by a non-main thread, which means if this await() times out which throws an Exception, the test will only fail if grep-for-suspect-strings catches it. Grep should find the logged Exception and fail it, but a better approach is this:

Add SharedErrorCollector rule:
```
import org.apache.geode.test.dunit.rules.SharedErrorCollector;

@Rule
public SharedErrorCollector errorCollector = new SharedErrorCollector();
```
And then use errorCollector in any callback you've implemented such as beforeProcessMessage:
```
public void beforeProcessMessage(ClusterDistributionManager dm, DistributionMessage message) {
  try {
    ...
  } catch (RuntimeException | Error e) {
    sharedErrorCollector.addError(e);
  }
}
```
ErrorCollector is a standard JUnit Rule, and SharedErrorCollector is special DUnit version that you can use from within any DUnit VM including the controller VM.

[ Full content available at: https://github.com/apache/geode/pull/2819 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org