mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-02 03:10:42 -05:00
Update test interfaces
This commit is contained in:
@@ -349,7 +349,7 @@ type noopTableFileDestStore struct {
|
||||
writeCalled atomic.Uint32
|
||||
}
|
||||
|
||||
func (s *noopTableFileDestStore) WriteTableFile(ctx context.Context, id string, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
func (s *noopTableFileDestStore) WriteTableFile(ctx context.Context, id string, splitOffset uint64, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
if s.writeDelay > 0 {
|
||||
time.Sleep(s.writeDelay)
|
||||
}
|
||||
@@ -373,7 +373,7 @@ type testDataTableFileDestStore struct {
|
||||
doneWriteTableFile chan struct{}
|
||||
}
|
||||
|
||||
func (s *testDataTableFileDestStore) WriteTableFile(ctx context.Context, id string, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
func (s *testDataTableFileDestStore) WriteTableFile(ctx context.Context, id string, splitOffset uint64, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
s.atWriteTableFile <- struct{}{}
|
||||
<-s.doWriteTableFile
|
||||
defer func() {
|
||||
@@ -400,7 +400,7 @@ type errTableFileDestStore struct {
|
||||
addCalled int
|
||||
}
|
||||
|
||||
func (s *errTableFileDestStore) WriteTableFile(ctx context.Context, id string, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
func (s *errTableFileDestStore) WriteTableFile(ctx context.Context, id string, splitOffset uint64, numChunks int, contentHash []byte, getRd func() (io.ReadCloser, uint64, error)) error {
|
||||
rd, _, _ := getRd()
|
||||
if rd != nil {
|
||||
rd.Close()
|
||||
|
||||
@@ -78,7 +78,7 @@ func writeLocalTableFiles(t *testing.T, st *NomsBlockStore, numTableFiles, seed
|
||||
fileID := addr.String()
|
||||
fileToData[fileID] = data
|
||||
fileIDToNumChunks[fileID] = i + 1
|
||||
err = st.WriteTableFile(ctx, fileID, i+1, nil, func() (io.ReadCloser, uint64, error) {
|
||||
err = st.WriteTableFile(ctx, fileID, 0, i+1, nil, func() (io.ReadCloser, uint64, error) {
|
||||
return io.NopCloser(bytes.NewReader(data)), uint64(len(data)), nil
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user