Skip to content

test(o11y): add GAPIC LRO tracing logical error integration test#5886

Open
haphungw wants to merge 2 commits into
googleapis:mainfrom
haphungw:fix-lro-tracing-gapic-logical-error
Open

test(o11y): add GAPIC LRO tracing logical error integration test#5886
haphungw wants to merge 2 commits into
googleapis:mainfrom
haphungw:fix-lro-tracing-gapic-logical-error

Conversation

@haphungw

Copy link
Copy Markdown
Contributor

Stacked on top of #5885

Adds an integration test validating the tracing behavior of GAPIC LROs that complete with a logical error (i.e. status code 3 / INVALID_ARGUMENT inside the operation body).

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces integration tests for Long-Running Operation (LRO) tracing within the observability tests module. It adds a new lro_tracing module that verifies tracing spans and attributes for both successful LRO polling and logical LRO failure scenarios. The review feedback suggests enhancing the test assertions by verifying the specific destination ID (operations/wait-2) in the logical error test case for both the LRO Wait and GetOperation spans, and refactoring the test to reuse the find_get_operation_spans helper function to eliminate duplicate span filtering logic.

Comment thread tests/o11y/src/lro_tracing.rs Outdated
Comment thread tests/o11y/src/lro_tracing.rs Outdated
Comment thread tests/o11y/src/lro_tracing.rs Outdated
@haphungw haphungw force-pushed the fix-lro-tracing-gapic-logical-error branch 2 times, most recently from 828819b to 8b00020 Compare June 15, 2026 20:26
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.90%. Comparing base (5102ca3) to head (1906ce2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5886   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files         233      233           
  Lines       59211    59211           
=======================================
  Hits        57968    57968           
  Misses       1243     1243           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haphungw haphungw force-pushed the fix-lro-tracing-gapic-logical-error branch 4 times, most recently from c2728a9 to eae050b Compare June 16, 2026 18:16
@haphungw haphungw marked this pull request as ready for review June 16, 2026 18:27
@haphungw haphungw requested a review from a team as a code owner June 16, 2026 18:27
attribute_str(lro_wait_span, "otel.status_code"),
Some("ERROR")
);
let actual_desc = attribute_str(lro_wait_span, "otel.status_description").unwrap_or_default();

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.

can we add an assertion on error.type here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did miss this in the implementation. The T3 span (GetOperation) already records this, but the T2 span (LRO) currently does not support error.type.

#5895 fixes this. Let's merge this first, and then I'll add the error.type assertions.

attribute_i64(get_op_span, "gcp.longrunning.status_code"),
Some(3)
);
assert_eq!(

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.

...and here.

It should be human readable and low-cardinality.

@haphungw haphungw force-pushed the fix-lro-tracing-gapic-logical-error branch from eae050b to e455a66 Compare June 16, 2026 22:25
@haphungw haphungw force-pushed the fix-lro-tracing-gapic-logical-error branch from e455a66 to 1906ce2 Compare June 17, 2026 20:46
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.

2 participants