Skip to content

Add conformance test cases for malformed nanos fields on Durations and Timestamps. #22995

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

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Aug 4, 2025

Add conformance test cases for malformed nanos fields on Durations and Timestamps.

Durations have a validity restriction on nanos that:

  • The range allowed is (-1s..1s) exclusive
  • The sign must match the sign of secs (for 0 secs both positive and negative values of nanos are allowed)

Timestamps have a validity restriction on nanos that:

  • The range allowed is [0..1s)

These cases have always been commented as only being valid under these constraints, and other validity constraints are already checked to be handled as ProtoJSON serialize-failures, but this particular condition was not covered by the conformance suite.

@copybara-service copybara-service bot force-pushed the test_790808910 branch 2 times, most recently from a0d52b0 to 7d9d267 Compare August 4, 2025 19:58
@copybara-service copybara-service bot changed the title Add conformance test cases for malformed durations. Add conformance test cases for malformed Durations and Timestamps. Aug 4, 2025
@copybara-service copybara-service bot changed the title Add conformance test cases for malformed Durations and Timestamps. Add conformance test cases for malformed nanos fields on Durations and Timestamps. Aug 4, 2025
@copybara-service copybara-service bot force-pushed the test_790808910 branch 2 times, most recently from 9481e47 to a003fe7 Compare August 5, 2025 12:52
…d Timestamps.

Durations have a validity restriction on `nanos` that:
- The range allowed is (-1s..1s) exclusive
- The sign must match the sign of `secs` (for 0 secs both positive and negative values of nanos are allowed)

Timestamps have a validity restriction on `nanos` that:
- The range allowed is [0..1s)

These cases have always been commented as only being valid under these constraints, and other validity constraints are already checked to be handled as ProtoJSON serialize-failures, but this particular condition was not covered by the conformance suite.

PiperOrigin-RevId: 791194939
@copybara-service copybara-service bot merged commit a6bdd0a into main Aug 5, 2025
@copybara-service copybara-service bot deleted the test_790808910 branch August 5, 2025 13:57
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.

1 participant