deepthi912 opened a new pull request, #20311:
URL: https://github.com/apache/pinot/pull/20311
## Summary
Many upsert and dedup integration tests checked only counts (`COUNT(*)`, raw
`skipUpsert` counts, result sizes)
or a single column, although the rows the table must serve are known. A
table can serve the wrong row per key
while every count stays right. This PR makes those tests compare the rows
they serve, fixes checks that could not
fail, and merges duplicated test code.
### Shared helpers (`pinot-integration-test-base`)
- `BaseClusterIntegrationTest.queryRows`, `assertRows`, `waitForRows`,
`describeRowDiff`: compare a query's rows
with expected rows. Every wait is bounded, and a failure prints the
missing and unexpected rows, e.g.
`Missing (expected, not served): [[0,"5",16071], ...] Unexpected (served,
not expected): [[0,"0",16071], ...]`.
- `ClusterIntegrationTestUtils.latestRowPerKey` (test oracle: latest Avro
record per key) and
`BaseClusterIntegrationTest.assertLatestRowPerKey`, for tests fed from
Avro fixtures with random values.
- `BaseClusterIntegrationTest.waitForAllStreamRecordsConsumed`: waits until
every stream partition has no records
lag, for rows a table is expected to drop.
### Count-only checks replaced with row checks
- Dedup: `BaseDedupIntegrationTest` (and the pauseless subclass),
`DedupPreloadIntegrationTest`,
`PauselessDedupErrorReplicaRepairTest` (every replica),
`PauselessDedupRealtimeIngestionSegmentCommitFailureTest`
(the recovered table was never queried; a `verifyRecoveredRows` hook now
checks it and the reference table).
- `UpsertTableIntegrationTest`: base table rows; delete tests check full
rows, the exact delete rows and the exact
5-row lineage of the revived key; compaction tests check the 3 winners of
`gameScores_large_csv` (before: a
count and one score cast to long) and that only the winners remain
physically after compaction.
- `UpsertSnapshotRestartIntegrationTest`: rows from phase 2 after restart
and reload (before: count 20, which also
passed with phase-1 rows).
- `UpsertTableSegmentUploadIntegrationTest`,
`UpsertTableSegmentPreloadIntegrationTest`,
`PartialUpsertTableRebalanceIntegrationTest`: latest row per key from the
Avro fixture, before and after restart,
rebalance and reload.
- `UpsertCompactMergeTaskIntegrationTest`, `custom/OfflineUpsertTableTest`,
`custom/VectorUpsertTableTest`.
- `CommitTimeCompactionIntegrationTest`: every test now checks its expected
rows on all three tables, before and
after the commit, and that each compacted table holds exactly those rows
physically (deleted keys' latest delete
rows included in the delete test).
### Checks that could not fail
- `BaseDedupIntegrationTest.testSegmentReload` pushed the data again and
asserted immediately, so "no change" held
before the re-pushed rows were consumed. It now waits until the stream is
fully consumed.
- `CommitTimeCompactionIntegrationTest.verifyTablesHaveIdenticalData` looked
up keys 100-102 only and skipped the
comparison when a key had no row, so the multi-value (200-202), mixed
(300-302) and map (400-402) tests compared
nothing, and the sorted-column test skipped 103-105. Replaced by absolute
expected rows.
-
`CommitTimeCompactionIntegrationTest.testCommitTimeCompactionWithNoDictionaryColumns`
set the no-dictionary
columns on the wrong config, so the baseline table never had them.
- `CommitTimeCompactionIntegrationTest` mixed-columns test waited on the
compacted table twice.
- `UpsertTableIntegrationTest` delete tests: the membership loop passed for
`[102, 102]`; lineage was `> 1`.
- `UpsertCompactMergeTaskIntegrationTest`: initial checks were `> 0` / `<=`;
captured scores were never compared;
stale `DEFAULT_COUNT_STAR_RESULT = 12` (the fixture has 10 rows) removed.
### Duplicates merged (no scenario dropped)
| Before | After | Covered by |
|---|---|---|
| `PartialUpsertTableRebalanceIntegrationTest.testRebalance` and
`testRebalanceWithBatching` (identical but for `batchSizePerServer`) |
`testRebalance` with a DataProvider over `{disabled, 1}` | same test, both
values |
| `UpsertTableSegmentPreloadIntegrationTest` copy of the upload test's
setup, waits, ideal-state check and test | Preload extends
`UpsertTableSegmentUploadIntegrationTest`, keeps only the snapshot/preload
server config, the pre-restart snapshot wait and the segment count after
restart | `UpsertTableSegmentUploadIntegrationTest.testSegmentAssignment` |
| Name-only loops in `BaseDedupIntegrationTest.testValues` /
`testValuesWithReplicas` / `testSegmentReload` and
`DedupPreloadIntegrationTest.testValues` | one shared `expectedRows()` /
`selectAllRowsQuery()` row check | the same four tests |
| 3-table schema/config setup and the update-commit-verify flow written out
in each of the 8 `CommitTimeCompactionIntegrationTest` tests (1388 lines) |
`createTables`, `updateCommitAndValidate`, `commitAndValidate` driven by each
test's rows (665 lines) | the same 8 tests |
| `UpsertCompactMergeTaskIntegrationTest.verifyDataIntegrityAfterMerge`
count / distinct / group-by checks | one row check |
`verifyDataIntegrityAfterMerge` |
### Unit tests (only where a check had no data)
- `BasePartitionUpsertMetadataManagerTest` snapshot tests asserted only
`getCardinality()` of bitmaps built from
literal doc ids; they now compare the doc ids.
- `ConcurrentMapPartitionUpsertMetadataManagerForConsistentDeletesTest`: the
last check of two tests was the map
size; they now check the valid doc ids and, for the immutable replacement,
the record location.
- `MutableSegmentDedupTest.testPrimaryKeyColumnsTakenFromDedupContext`
checked one doc indexed; it now checks it is
the first record.
## Validation
- All changed integration tests pass locally (42 tests, 15 classes):
`BaseDedupIntegrationTest`, `DedupPreloadIntegrationTest`,
`UpsertTableIntegrationTest`, `UpsertSnapshotRestartIntegrationTest`,
`CommitTimeCompactionIntegrationTest`,
`UpsertCompactMergeTaskIntegrationTest`,
`UpsertTableSegmentUploadIntegrationTest`,
`UpsertTableSegmentPreloadIntegrationTest`,
`PartialUpsertTableRebalanceIntegrationTest`,
`PauselessDedupErrorReplicaRepairTest`,
`PauselessDedupRealtimeIngestionSegmentCommitFailureTest`,
`PauselessRealtimeIngestionSegmentCommitFailureTest`,
`PauselessRealtimeIngestionWithDedupIntegrationTest`,
`OfflineUpsertTableTest`, `VectorUpsertTableTest`.
- Changed unit test classes pass (45 tests).
- The row check fails when it should: with the dedup expectation set to the
second row per id, all three dedup
tests fail with the missing/unexpected row diff shown above.
- `checkstyle:check license:check` pass on the three modules.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]