diff --git a/delete_test.go b/delete_test.go index df6249ca9..2b4e7035f 100644 --- a/delete_test.go +++ b/delete_test.go @@ -55,15 +55,20 @@ func TestExecutor_DeleteRecords(t *testing.T) { t.Helper() fieldName := "setfield" c.CreateField(t, indexName, pilosa.IndexOptions{TrackExistence: true}, fieldName) - rows := make([][2]uint64, ShardWidth*Rows) - for columnID := uint64(0); columnID < ShardWidth; columnID++ { + // we don't need to populate the whole thing, just enough to get a sample of it + width := uint64(ShardWidth / 4) + rows := make([][2]uint64, width*Rows) + n := 0 + // populate rows with decreasing density + for columnID := uint64(0); columnID < width; columnID++ { for rowID := uint64(0); rowID < Rows; rowID++ { - if rowID == 0 || (columnID%rowID+1) != 0 { - rows[rowID] = [2]uint64{rowID, columnID} + if (columnID % (rowID + 1)) == 0 { + rows[n] = [2]uint64{rowID, columnID} + n++ } } } - c.ImportBits(t, indexName, "setfield", rows) + c.ImportBits(t, indexName, "setfield", rows[:n]) } setupKeys := func(t *testing.T, r *require.Assertions, c *test.Cluster) { @@ -257,7 +262,6 @@ func TestExecutor_DeleteRecords(t *testing.T) { require.NoError(err, "restart cluster DeleteRecordsBig") err = c.AwaitState(disco.ClusterStateNormal, 10*time.Second) require.NoError(err, "backToNormal") - }) }