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

tablehandle_test.TestAsOfJoin is a random failer due to racy assertions #4741

Closed
rcaudy opened this issue Oct 30, 2023 · 2 comments · Fixed by #4971
Closed

tablehandle_test.TestAsOfJoin is a random failer due to racy assertions #4741

rcaudy opened this issue Oct 30, 2023 · 2 comments · Fixed by #4971
Assignees
Labels
bug Something isn't working ci go-client
Milestone

Comments

@rcaudy
Copy link
Member

rcaudy commented Oct 30, 2023

See core/go/pkg/client/tablehandle_test.go:372

This caused a nightly failure:

  === RUN   TestAsOfJoin
      tablehandle_test.go:425: record had wrong size

There are two things wrong with this test:

  1. It is reversing the sense of "as of join" and "reverse as of join", thus providing a poor example for users to learn from
  2. It is asserting incorrect things about the relationship between the sizes of independent snapshots
@rcaudy rcaudy added bug Something isn't working ci go-client labels Oct 30, 2023
@rcaudy rcaudy added this to the October 2023 milestone Oct 30, 2023
@rcaudy
Copy link
Member Author

rcaudy commented Oct 30, 2023

	ttRec, err := tt1.Snapshot(ctx)
	test_tools.CheckError(t, "Snapshot", err)
	defer ttRec.Release()

	normalRec, err := normalTbl.Snapshot(ctx)
	test_tools.CheckError(t, "Snapshot", err)
	defer normalRec.Release()

	reverseRec, err := reverseTbl.Snapshot(ctx)
	test_tools.CheckError(t, "Snapshot", err)
	defer reverseRec.Release()

	if normalRec.NumRows() == 0 || normalRec.NumRows() > ttRec.NumRows() {
		t.Error("record had wrong size")
		return
	}

	if reverseRec.NumRows() == 0 || reverseRec.NumRows() > ttRec.NumRows() {
		t.Error("record had wrong size")
		return
	}

If you were to hold a lock that prevented the update graph from progressing while you took all three snapshots, these assertions would be valid. Without that, they are invalid.

@kosak
Copy link
Contributor

kosak commented Dec 28, 2023

Fixed by #4971

@kosak kosak closed this as completed Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci go-client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants