Skip to content

[Java] Avoid duplicate timestamps in InfluxDB fixtures - #40772

Open
bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/influx-test-point-identities
Open

bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/influx-test-point-identities

Conversation

@bvolpato

Copy link
Copy Markdown
Contributor

Related #26866.

The fixture generates nanosecond timestamps but writes with millisecond precision. Points for the same measurement can land on the same millisecond, and InfluxDB merges them. Preserve the random timestamps while advancing collisions, and use the same generator for multi-metric data.

Reproduced the missing-point failure in the existing integration test against InfluxDB 1.8, then reran it successfully with the fix. The full integration class, module tests, and formatting checks also passed. The local module checks can be run with ./gradlew :sdks:java:io:influxdb:test :sdks:java:io:influxdb:spotlessJavaCheck.

@github-actions github-actions Bot added java io size/s S: 10-49 lines changed labels Oct 25, 2026
@bvolpato
bvolpato marked this pull request as ready for review October 25, 2026 05:38

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR resolves a test data collision issue in GenerateData where random timestamps truncated to millisecond precision could collide for the same measurement, causing InfluxDB to merge points and fail count assertions in InfluxDbIOIT. The fix cleanly tracks per-measurement timestamps, increments on collision, and removes code duplication between getMetric and getMultipleMetric.

🔍 General Feedback

  • The implementation is clean, concise, and properly scopes timestamp deduplication per measurement (even if duplicate measurement names are passed to getMultipleMetric).
  • Eliminating the duplicated point generation loop in getMultipleMetric improves maintainability.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @chamikaramj for label java.
Backup reviewer: Abacn (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant