This is an automated email from the ASF dual-hosted git repository.
eolivelli pushed a commit to branch branch-4.12
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.12 by this push:
new f44ec4b Fix: Multiple tests failing in /stream subproject
f44ec4b is described below
commit f44ec4b3f501912f37e145c4e55021166d4c03c9
Author: Andrey Yegorov <[email protected]>
AuthorDate: Tue Feb 2 23:28:07 2021 -0800
Fix: Multiple tests failing in /stream subproject
Descriptions of the changes in this PR:
Fixed (some of) the test failures.
Other tests need more work, some of them succeed on retry, some might fail
but for different reasons.
To be continued.
### Motivation
the tests shall pass
### Changes
Fixed: missing dependencies for some subprojects
Fixed: mock setup for some tests
Master Issue: #2577
Reviewers: Enrico Olivelli <[email protected]>, Prashant Kumar
This closes #2578 from dlg99/master-test-fix
(cherry picked from commit 37e562225c83c227e5994e5a327181fca22d515b)
Signed-off-by: Enrico Olivelli <[email protected]>
---
stream/statelib/pom.xml | 75 ++++++++++++++++++++++
stream/storage/impl/pom.xml | 75 ++++++++++++++++++++++
.../impl/store/MVCCStoreFactoryImplTest.java | 1 +
3 files changed, 151 insertions(+)
diff --git a/stream/statelib/pom.xml b/stream/statelib/pom.xml
index 9909048..1e6eb17 100644
--- a/stream/statelib/pom.xml
+++ b/stream/statelib/pom.xml
@@ -71,6 +71,81 @@
<version>${project.parent.version}</version>
<classifier>tests</classifier>
</dependency>
+
+ <!-- zookeeper -->
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>net.java.dev.javacc</groupId>
+ <artifactId>javacc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>${zookeeper.version}</version>
+ <type>test-jar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- dependency needed for zookeeper jetty admin server -->
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>${jackson-mapper-asl.version}</version>
+ </dependency>
+
+ <dependency>
+ <!-- needed by ZooKeeper server -->
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>${snappy.version}</version>
+ </dependency>
+
+ <!-- dropwizard metrics, for stats and for ZooKeeper server -->
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ <version>${dropwizard.version}</version>
+ </dependency>
+
</dependencies>
<build>
<extensions>
diff --git a/stream/storage/impl/pom.xml b/stream/storage/impl/pom.xml
index 07391f7..a60c9ec 100644
--- a/stream/storage/impl/pom.xml
+++ b/stream/storage/impl/pom.xml
@@ -72,6 +72,81 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+
+ <!-- zookeeper -->
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>net.java.dev.javacc</groupId>
+ <artifactId>javacc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ <version>${zookeeper.version}</version>
+ <type>test-jar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- dependency needed for zookeeper jetty admin server -->
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>${jackson-mapper-asl.version}</version>
+ </dependency>
+
+ <dependency>
+ <!-- needed by ZooKeeper server -->
+ <groupId>org.xerial.snappy</groupId>
+ <artifactId>snappy-java</artifactId>
+ <version>${snappy.version}</version>
+ </dependency>
+
+ <!-- dropwizard metrics, for stats and for ZooKeeper server -->
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ <version>${dropwizard.version}</version>
+ </dependency>
+
</dependencies>
<build>
<plugins>
diff --git
a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/store/MVCCStoreFactoryImplTest.java
b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/store/MVCCStoreFactoryImplTest.java
index 9372adf..65d9261 100644
---
a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/store/MVCCStoreFactoryImplTest.java
+++
b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/store/MVCCStoreFactoryImplTest.java
@@ -74,6 +74,7 @@ public class MVCCStoreFactoryImplTest {
when(namespace.openLog(anyString())).thenReturn(dlm);
AsyncLogWriter logWriter = mock(AsyncLogWriter.class);
when(dlm.openAsyncLogWriter()).thenReturn(FutureUtils.value(logWriter));
+
when(dlm.openAsyncLogWriter(any())).thenReturn(FutureUtils.value(logWriter));
when(logWriter.getLastTxId()).thenReturn(-1L);
DLSN dlsn = new DLSN(0L, 0L, 0L);
when(logWriter.write(any(LogRecord.class))).thenReturn(FutureUtils.value(dlsn));