Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,19 @@ public void test_runKafkaSupervisor()
Assertions.assertEquals(1, taskStatuses.size());
Assertions.assertEquals(TaskState.RUNNING, taskStatuses.get(0).getStatusCode());

// Wait until all produced records have been ingested before verifying the row count,
// otherwise the query below can race ingestion and observe fewer than the expected rows
indexer.latchableEmitter().waitForEventAggregate(
event -> event.hasMetricName("ingest/events/processed")
.hasDimension(DruidMetrics.DATASOURCE, dataSource),
agg -> agg.hasSumAtLeast(expectedSegments)
);

// Verify the count of rows ingested into the datasource so far
Assertions.assertEquals("10", cluster.runSql("SELECT COUNT(*) FROM %s", dataSource));
Assertions.assertEquals(
String.valueOf(expectedSegments),
cluster.runSql("SELECT COUNT(*) FROM %s", dataSource)
);

// Suspend the supervisor and verify the state
cluster.callApi().postSupervisor(kafkaSupervisorSpec.createSuspendedSpec());
Expand Down
Loading