mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
use separate qcx for write/read in test
now that min/max queries don't use a write Tx it seems we need to
separate read and write in the tests. Not sure I 100% understand this.
(cherry picked from commit a58299def4)
This commit is contained in:
parent
da85614c24
commit
da4a42dfe9
1 changed files with 8 additions and 4 deletions
|
|
@ -692,9 +692,6 @@ func TestDecimalField_MinMaxBoundaries(t *testing.T) {
|
|||
func TestDecimalField_MinMaxForShard(t *testing.T) {
|
||||
_, _, f := newTestField(t, OptFieldTypeDecimal(3))
|
||||
|
||||
qcx := f.idx.holder.txf.NewQcx()
|
||||
defer qcx.Abort()
|
||||
|
||||
options := &ImportOptions{}
|
||||
for i, test := range []struct {
|
||||
name string
|
||||
|
|
@ -738,12 +735,19 @@ func TestDecimalField_MinMaxForShard(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(test.name+strconv.Itoa(i), func(t *testing.T) {
|
||||
if err := f.importFloatValue(qcx, test.columnIDs, test.values, 0, options); err != nil {
|
||||
qcx := f.idx.holder.txf.NewQcx()
|
||||
|
||||
err := f.importFloatValue(qcx, test.columnIDs, test.values, 0, options)
|
||||
if err != nil {
|
||||
qcx.Abort()
|
||||
t.Fatalf("test %d, importing values: %s", i, err.Error())
|
||||
}
|
||||
qcx.Abort()
|
||||
|
||||
shard := uint64(0)
|
||||
|
||||
qcx = f.idx.holder.txf.NewQcx()
|
||||
defer qcx.Abort()
|
||||
maxvc, err := f.MaxForShard(qcx, shard, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("getting max for shard: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue