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

[ENH]: Add property test log service #1969

Merged
merged 22 commits into from
Apr 4, 2024
Merged

Conversation

nicolasgere
Copy link
Contributor

@nicolasgere nicolasgere commented Apr 3, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Add property testing for log service

Copy link
Contributor Author

nicolasgere commented Apr 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @nicolasgere and the rest of your teammates on Graphite Graphite

@nicolasgere nicolasgere mentioned this pull request Apr 3, 2024
1 task
Copy link

github-actions bot commented Apr 3, 2024

Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas

Copy link

github-actions bot commented Apr 3, 2024

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@nicolasgere nicolasgere changed the title add property test [ENH]: add property test Apr 3, 2024
@nicolasgere nicolasgere marked this pull request as ready for review April 3, 2024 19:51
@nicolasgere nicolasgere changed the base branch from 04-01-refactor_log_service to main April 3, 2024 20:24
@nicolasgere nicolasgere changed the title [ENH]: add property test [ENH]: Add property test log service Apr 3, 2024
CollectionId: c.String(),
StartFromOffset: startOffset,
BatchSize: batchSize,
EndTimestamp: time.Now().Unix(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also generate the EndTimestamp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, once I have it deploy to staging, i would like to pass even more time on making the property test even better, like parallelism, more logs, use timestamp etc

suite.model.CollectionData[c] = append(suite.model.CollectionData[c], records...)
},
"getAllCollectionsToCompact": func(t *rapid.T) {
result, err := suite.logServer.GetAllCollectionInfoToCompact(ctx, &logservicepb.GetAllCollectionInfoToCompactRequest{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add more sanity check for getAllCollectionsToCompact? One check could be the checking the number of collections to compact matches the number of collections in the model.

if startOffset == 0 {
startOffset = 1
}
batchSize := rapid.Int32Range(1, 20).Draw(t, "batch_size")
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple of questions:

  • What is the behavior if batchSize <= 1? Especially batchSize <= 0?
  • What is the reasoning behind using (1, 20) as the batchSize range?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was just way to have random number, I don't know what it would be in production.

}
}

// Verify that the first and last record offset is correct
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we verify the offset in the middle of the batch as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the number count and the first and last offset is correct, I expect the offset to be correct for all of them.

@nicolasgere nicolasgere merged commit 74cc70c into main Apr 4, 2024
120 checks passed
nicolasgere added a commit that referenced this pull request Apr 4, 2024
*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Add property testing for log service
@HammadB HammadB mentioned this pull request Jul 2, 2024
1 task
HammadB added a commit that referenced this pull request Jul 3, 2024
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- When revamping the prop tests in #1969 I noticed that the purge code
was off by one - this remedies that.
 - New functionality
	 - None

## Test plan
*How are these changes tested?*
The tests TODO is updated with the correct behavior
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
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.

2 participants