Skip to content

Commit

Permalink
fixed some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Dec 27, 2024
1 parent 6569378 commit 45c9b8b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
1 change: 0 additions & 1 deletion posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ func RemoveCacheFor(key []byte) {
type MemoryLayer struct {
cache *ristretto.Cache[[]byte, *CachePL]

insert int
numCacheRead int
numCacheReadFails int
numDisksRead int
Expand Down
6 changes: 3 additions & 3 deletions posting/mvcc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ func BenchmarkTestCache(b *testing.B) {

attr := x.GalaxyAttr("cache")
keys := make([][]byte, 0)
N := 10000
N := uint64(10000)
txn := Oracle().RegisterStartTs(1)

for i := uint64(1); i < uint64(N); i++ {
for i := uint64(1); i < N; i++ {
key := x.DataKey(attr, i)
keys = append(keys, key)
edge := &pb.DirectedEdge{
Expand All @@ -143,7 +143,7 @@ func BenchmarkTestCache(b *testing.B) {

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
key := keys[rand.Intn(N-1)]
key := keys[rand.Intn(int(N)-1)]

Check failure on line 146 in posting/mvcc_test.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion uint64 -> int (gosec)
_, err = getNew(key, pstore, math.MaxUint64)
if err != nil {
panic(err)
Expand Down
21 changes: 18 additions & 3 deletions systest/21million/bulk/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestQueries(t *testing.T) {
}

func BenchmarkQueries(b *testing.B) {

_, thisFile, _, _ := runtime.Caller(0)
queryDir := filepath.Join(filepath.Dir(thisFile), "../queries")

Expand All @@ -54,8 +53,6 @@ func BenchmarkQueries(b *testing.B) {
panic(fmt.Sprintf("Error reading directory: %s", err.Error()))
}

//savepath := ""
//diffs := 0
for _, file := range files {
if !strings.HasPrefix(file.Name(), "query-") {
continue
Expand Down Expand Up @@ -83,6 +80,24 @@ func BenchmarkQueries(b *testing.B) {
}

func TestMain(m *testing.M) {
schemaFile := filepath.Join(testutil.TestDataDirectory, "21million.schema")
rdfFile := filepath.Join(testutil.TestDataDirectory, "21million.rdf.gz")
if err := testutil.MakeDirEmpty([]string{"out/0", "out/1", "out/2"}); err != nil {
os.Exit(1)
}

if err := testutil.BulkLoad(testutil.BulkOpts{
Zero: testutil.SockAddrZero,
Shards: 1,
RdfFile: rdfFile,
SchemaFile: schemaFile,
}); err != nil {
cleanupAndExit(1)
}

if err := testutil.StartAlphas("./alpha.yml"); err != nil {
cleanupAndExit(1)
}
exitCode := m.Run()
cleanupAndExit(exitCode)
}
Expand Down

0 comments on commit 45c9b8b

Please sign in to comment.