mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Update field_internal_test.go
This commit is contained in:
parent
1e6b8434eb
commit
79eaae7881
1 changed files with 0 additions and 74 deletions
|
|
@ -395,80 +395,6 @@ func TestField_PersistAvailableShards(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
// This test is wrong. I don't understand what this is supposed to be doing.
|
||||
func TestField_TruncatedAvailableShards(t *testing.T) {
|
||||
availableShardFileFlushDuration.Set(200 * time.Millisecond) //shorten the default time to force a file write
|
||||
f := OpenField(t, OptFieldTypeDefault())
|
||||
defer f.Close()
|
||||
|
||||
// bm represents remote available shards.
|
||||
bm := roaring.NewBitmap(1, 2, 3)
|
||||
|
||||
if err := f.AddRemoteAvailableShards(bm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(2 * availableShardFileFlushDuration.Get())
|
||||
f.remoteAvailableShards = roaring.NewBitmap()
|
||||
|
||||
if !reflect.DeepEqual(f.protectedRemoteAvailableShards().Slice(), []uint64(nil)) {
|
||||
t.Fatalf("unexpected available shards (reopen). expected: %#v, but got: %#v", []uint64{}, f.protectedRemoteAvailableShards().Slice())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// This test is also wrong. It just unions the thing instead of testing anything.
|
||||
// Ensure that persisting available shards having a smaller footprint (for example,
|
||||
// when going from a bitmap to a smaller, RLE representation) succeeds.
|
||||
func TestField_PersistAvailableShardsFootprint(t *testing.T) {
|
||||
availableShardFileFlushDuration.Set(200 * time.Millisecond) //shorten the default time to force a file write
|
||||
f := OpenField(t, OptFieldTypeDefault())
|
||||
defer f.Close()
|
||||
|
||||
// bm represents remote available shards.
|
||||
bm := roaring.NewBitmap()
|
||||
for i := uint64(0); i < 1204; i += 2 {
|
||||
_, err := bm.Add(i)
|
||||
if err != nil {
|
||||
t.Fatalf("adding bits: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := f.AddRemoteAvailableShards(bm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(2 * availableShardFileFlushDuration.Get())
|
||||
|
||||
if err := f.loadAvailableShards(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
bm1 := roaring.NewBitmap()
|
||||
for i := uint64(1); i < 1204; i += 2 {
|
||||
_, err := bm1.Add(i)
|
||||
if err != nil {
|
||||
t.Fatalf("adding bits: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := f.AddRemoteAvailableShards(bm1); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Reload field and verify that shard data is persisted.
|
||||
result := bm.Union(bm1)
|
||||
|
||||
if err := f.loadAvailableShards(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(f.remoteAvailableShards.Slice(), result.Slice()) {
|
||||
t.Fatalf("unexpected available shards (reload). expected: %v, but got: %v", bm.Slice(), f.remoteAvailableShards.Slice())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Ensure that FieldOptions.Base defaults to the correct value.
|
||||
func TestBSIGroup_BaseDefaultValue(t *testing.T) {
|
||||
for i, tt := range []struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue