Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: introduce optional shard cache #713

Merged
merged 1 commit into from
Jan 11, 2024
Merged

e2e: introduce optional shard cache #713

merged 1 commit into from
Jan 11, 2024

Conversation

keegancsmith
Copy link
Member

While iterating on the ranking tests it is frustrating to wait for the index to be built. This commit adds a "-shard_cache" flag to reuse the computed shards. It defaults to off since this could lead to unexpected results if we change how we index.

This is another take on #697

Test Plan: run go test several times with the flag, only the first run should be slow. Then confirm without flag it is "slow".

$ go test -shard_cache
PASS
ok      github.com/sourcegraph/zoekt/internal/e2e       23.307s
$ go test -shard_cache
PASS
ok      github.com/sourcegraph/zoekt/internal/e2e       0.235s
$ go test -shard_cache
PASS
ok      github.com/sourcegraph/zoekt/internal/e2e       0.218s
$ go test
PASS
ok      github.com/sourcegraph/zoekt/internal/e2e       23.416s

While iterating on the ranking tests it is frustrating to wait for the
index to be built. This commit adds a "-shard_cache" flag to reuse the
computed shards. It defaults to off since this could lead to unexpected
results if we change how we index.

Test Plan: run go test several times with the flag, only the first run
should be slow. Then confirm without flag it is "slow".

  $ go test -shard_cache
  PASS
  ok      github.com/sourcegraph/zoekt/internal/e2e       23.307s
  $ go test -shard_cache
  PASS
  ok      github.com/sourcegraph/zoekt/internal/e2e       0.235s
  $ go test -shard_cache
  PASS
  ok      github.com/sourcegraph/zoekt/internal/e2e       0.218s
  $ go test
  PASS
  ok      github.com/sourcegraph/zoekt/internal/e2e       23.416s
@keegancsmith keegancsmith merged commit 344e33a into main Jan 11, 2024
8 checks passed
@keegancsmith keegancsmith deleted the k/shard-cache branch January 11, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants