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

[MySQL] make the tests go faster #392

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions storage/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,20 @@ func TestGetTile(t *testing.T) {
awaiter := tessera.NewIntegrationAwaiter(ctx, s.ReadCheckpoint, 10*time.Millisecond)

treeSize := 258
var lastIndex uint64

wg := errgroup.Group{}
for i := range treeSize {
idx, _, err := awaiter.Await(ctx, s.Add(ctx, tessera.NewEntry([]byte(fmt.Sprintf("TestGetTile %d", i)))))
if err != nil {
t.Fatalf("Failed to prep test with entry: %v", err)
}
if idx > lastIndex {
lastIndex = idx
}
wg.Go(
func() error {
_, _, err := awaiter.Await(ctx, s.Add(ctx, tessera.NewEntry([]byte(fmt.Sprintf("TestGetTile %d", i)))))
if err != nil {
return fmt.Errorf("failed to prep test with entry: %v", err)
}
return nil
})
}
if got, want := lastIndex, uint64(treeSize-1); got != want {
t.Fatalf("expected only newly created entries in database; tests are not hermetic (got %d, want %d)", got, want)
if err := wg.Wait(); err != nil {
t.Fatalf("Failed to set up database with required leaves: %v", err)
}

for _, test := range []struct {
Expand Down
Loading