-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[indexer alt] add collector tests #20413
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
24abd0a
to
e889c67
Compare
self.values.is_empty() | ||
let empty = self.values.is_empty(); | ||
if empty { | ||
debug_assert!(self.watermark.batch_rows == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this debug assert is only true when pending is actually empty thus the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Makes complete sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just nits, thanks @emmazzz
self.values.is_empty() | ||
let empty = self.values.is_empty(); | ||
if empty { | ||
debug_assert!(self.watermark.batch_rows == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Makes complete sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: file order -- can you move this trait impl to the bottom of the file? (also, expect some changes to these types in the file-based config stack!)
assert_eq!(batch2.len(), 2); | ||
|
||
let batch3 = collector_rx.recv().await.unwrap(); | ||
assert_eq!(batch3.len(), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this expected, why do we want to send empty batches if so? also cc @amnn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A batch can have zero rows but still contains watermark updates.
e889c67
to
aa05fe3
Compare
@@ -257,5 +257,9 @@ pub(crate) fn pipeline<H: Handler + Send + Sync + 'static>( | |||
} | |||
|
|||
const fn max_chunk_rows<H: Handler>() -> usize { | |||
// Handle division by zero | |||
if H::Value::FIELD_COUNT == 0 { | |||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably won't happen in real life since I don't think any value will have zero fields, but it can happen in tests and just in case.
Description
Added tests for indexer alt collector and also corrected a potential debug assert.
Test plan
Added tests.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.