[#142] Fix multipart-objects download
Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
This commit is contained in:
parent
77eb474581
commit
2eefa7c08b
13 changed files with 628 additions and 85 deletions
|
@ -21,10 +21,10 @@ func (m nodeMeta) GetValue() []byte {
|
|||
|
||||
type nodeResponse struct {
|
||||
meta []nodeMeta
|
||||
timestamp uint64
|
||||
timestamp []uint64
|
||||
}
|
||||
|
||||
func (n nodeResponse) GetTimestamp() uint64 {
|
||||
func (n nodeResponse) GetTimestamp() []uint64 {
|
||||
return n.timestamp
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ func TestGetLatestNode(t *testing.T) {
|
|||
name: "one node of the object version",
|
||||
nodes: []NodeResponse{
|
||||
nodeResponse{
|
||||
timestamp: 1,
|
||||
timestamp: []uint64{1},
|
||||
meta: []nodeMeta{
|
||||
{
|
||||
key: oidKV,
|
||||
|
@ -67,11 +67,11 @@ func TestGetLatestNode(t *testing.T) {
|
|||
name: "one node of the object version and one node of the secondary object",
|
||||
nodes: []NodeResponse{
|
||||
nodeResponse{
|
||||
timestamp: 3,
|
||||
timestamp: []uint64{3},
|
||||
meta: []nodeMeta{},
|
||||
},
|
||||
nodeResponse{
|
||||
timestamp: 1,
|
||||
timestamp: []uint64{1},
|
||||
meta: []nodeMeta{
|
||||
{
|
||||
key: oidKV,
|
||||
|
@ -86,11 +86,11 @@ func TestGetLatestNode(t *testing.T) {
|
|||
name: "all nodes represent a secondary object",
|
||||
nodes: []NodeResponse{
|
||||
nodeResponse{
|
||||
timestamp: 3,
|
||||
timestamp: []uint64{3},
|
||||
meta: []nodeMeta{},
|
||||
},
|
||||
nodeResponse{
|
||||
timestamp: 5,
|
||||
timestamp: []uint64{5},
|
||||
meta: []nodeMeta{},
|
||||
},
|
||||
},
|
||||
|
@ -100,7 +100,7 @@ func TestGetLatestNode(t *testing.T) {
|
|||
name: "several nodes of different types and with different timestamp",
|
||||
nodes: []NodeResponse{
|
||||
nodeResponse{
|
||||
timestamp: 1,
|
||||
timestamp: []uint64{1},
|
||||
meta: []nodeMeta{
|
||||
{
|
||||
key: oidKV,
|
||||
|
@ -109,11 +109,11 @@ func TestGetLatestNode(t *testing.T) {
|
|||
},
|
||||
},
|
||||
nodeResponse{
|
||||
timestamp: 3,
|
||||
timestamp: []uint64{3},
|
||||
meta: []nodeMeta{},
|
||||
},
|
||||
nodeResponse{
|
||||
timestamp: 4,
|
||||
timestamp: []uint64{4},
|
||||
meta: []nodeMeta{
|
||||
{
|
||||
key: oidKV,
|
||||
|
@ -122,7 +122,7 @@ func TestGetLatestNode(t *testing.T) {
|
|||
},
|
||||
},
|
||||
nodeResponse{
|
||||
timestamp: 6,
|
||||
timestamp: []uint64{6},
|
||||
meta: []nodeMeta{},
|
||||
},
|
||||
},
|
||||
|
@ -130,7 +130,7 @@ func TestGetLatestNode(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
actualNode, err := getLatestNode(tc.nodes)
|
||||
actualNode, err := getLatestVersionNode(tc.nodes)
|
||||
if tc.error {
|
||||
require.Error(t, err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue