Skip to content

Commit

Permalink
make test easier to read
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Dec 20, 2024
1 parent c0393c5 commit 0dbe347
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions go/vt/vtgate/scatter_conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ func TestFetchLastInsertIDResets(t *testing.T) {
}}

session := econtext.NewSafeSession(&vtgatepb.Session{Options: &querypb.ExecuteOptions{}})
_, errs := sc.ExecuteMultiShard(ctx, nil, rss, queries, session, true /*autocommit*/, false, nullResultsObserver{}, true)

fetchLastInsertID := true
_, errs := sc.ExecuteMultiShard(ctx, nil, rss, queries, session, true /*autocommit*/, false, nullResultsObserver{}, fetchLastInsertID)
require.NoError(t, vterrors.Aggregate(errs))
assert.True(t, session.Options.FetchLastInsertId)

_, errs = sc.ExecuteMultiShard(ctx, nil, rss, queries, session, true /*autocommit*/, false, nullResultsObserver{}, false)
fetchLastInsertID = false
_, errs = sc.ExecuteMultiShard(ctx, nil, rss, queries, session, true /*autocommit*/, false, nullResultsObserver{}, fetchLastInsertID)
require.NoError(t, vterrors.Aggregate(errs))
assert.False(t, session.Options.FetchLastInsertId)
}
Expand Down
4 changes: 3 additions & 1 deletion go/vt/wrangler/vdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ type shardStreamer struct {
err error
}

var _ engine.StreamExecutor = (*shardStreamer)(nil)

// VDiff reports differences between the sources and targets of a vreplication workflow.
func (wr *Wrangler) VDiff(ctx context.Context, targetKeyspace, workflowName, sourceCell, targetCell, tabletTypesStr string,
filteredReplicationWaitTime time.Duration, format string, maxRows int64, tables string, debug, onlyPks bool,
Expand Down Expand Up @@ -1148,7 +1150,7 @@ func (pe *primitiveExecutor) drain(ctx context.Context) (int, error) {
// -----------------------------------------------------------------
// shardStreamer

func (sm *shardStreamer) StreamExecute(ctx context.Context, vcursor engine.VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
func (sm *shardStreamer) StreamExecute(_ context.Context, _ engine.VCursor, _ map[string]*querypb.BindVariable, _, _ bool, callback func(*sqltypes.Result) error) error {
for result := range sm.result {
if err := callback(result); err != nil {
return err
Expand Down

0 comments on commit 0dbe347

Please sign in to comment.