[CURATOR-282] In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Here is a junit test write in groovy.
import org.apache.curator.framework.CuratorFramework
import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.RetryOneTime
import org.apache.curator.test.TestingServer
import org.apache.zookeeper.CreateMode
import org.junit.After
import org.junit.Before
import org.junit.Testpublic class PlayZK {
private TestingServer server
private CuratorFramework client@Before
public void setup() {
server = new TestingServer(8788)
server.start();
println "ConnectString: " + server.getConnectString()
client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(8000))
client.start()
}@Test
public void issues() {
println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/test/data/sub");
println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/sub");
println "Create sub " + client.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")
println "Create sub " + client.usingNamespace("test/data").create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")println "Expected sub"
client.children.forPath("/test/data").each {println it}
println "Expected 0000000000"
client.children.forPath("/test/data/sub").each {println it}
println "Expected 0000000000"
client.children.forPath("/sub").each {println it}
}@After
public void down() {
server.stop()
}
}
// will create /test/data/sub0000000001
client.usingNamespace("test/data").create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")// will create /test/data/sub/0000000000
client.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")
Which one is expected ?
---
Originally reported by wener, imported from: In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.