Skip to content

Conversation

msbutler
Copy link
Collaborator

Epic: none

Release note: none

@msbutler msbutler self-assigned this Sep 12, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@msbutler msbutler marked this pull request as ready for review September 12, 2025 19:45
@msbutler msbutler requested review from a team as code owners September 12, 2025 19:45
@msbutler msbutler requested review from kev-cao and andyyang890 and removed request for a team September 12, 2025 19:45
Copy link
Collaborator

@andyyang890 andyyang890 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test!

}

func checkSpanFrontierEquality(t *testing.T, expected span.Frontier, actual span.Frontier) {
for eSp, eTs := range expected.Entries() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop technically only checks that expected is a subset of actual. Should we also assert that the number of entries is the same (maybe with .Len())?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. added a len check.

require.NoError(t, err)
}

jobID := jobspb.JobID(3000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you want to keep the trend of each test in this file generating different job IDs, consider making this 4000

Copy link
Collaborator Author

@msbutler msbutler Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that really adds any test coverage. each test uses its own test server.

newTs := hlc.Timestamp{WallTime: int64(rng.Intn(4))}

// Only update if new timestamp is greater (frontiers only move forward)
if initialTimestamps[spanIdx].Less(newTs) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You technically don't need to do this check since Forward will no-op if you're not forwarding to a later time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right! removed that check and it simplifies things slightly.

Epic: none

Release note: none
@msbutler msbutler force-pushed the butler-job-frontier-random branch from 68ee697 to b4e47cf Compare September 13, 2025 13:58
Copy link
Collaborator Author

@msbutler msbutler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the close review!

require.NoError(t, err)
}

jobID := jobspb.JobID(3000)
Copy link
Collaborator Author

@msbutler msbutler Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that really adds any test coverage. each test uses its own test server.

newTs := hlc.Timestamp{WallTime: int64(rng.Intn(4))}

// Only update if new timestamp is greater (frontiers only move forward)
if initialTimestamps[spanIdx].Less(newTs) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right! removed that check and it simplifies things slightly.

}

func checkSpanFrontierEquality(t *testing.T, expected span.Frontier, actual span.Frontier) {
for eSp, eTs := range expected.Entries() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. added a len check.

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.

3 participants