Skip to content

PHOENIX-8101 PhoenixMetricsIT asserts nonzero millisecond timings for short operations - #2733

Open
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8101
Open

apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8101

Conversation

@apurtell

@apurtell apurtell commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Some global metric checks fail intermittently on fast hosts. The time between scanner next calls is a sum of wall-clock millisecond deltas. The global metric tests scan a few rows in one region, which takes one RPC. When that RPC completes in the same millisecond tick, the sum is 0. The mutation commit time is also a millisecond delta, and a small commit can also give 0. In both cases 0 is a correct value.

The change is test-only. The checks on these two metrics now require a recorded sample, not a nonzero value. The tests reset the metrics before each measured operation, so the check still proves that the operation records the metric. The checks on the other metrics do not change.

🤖 Generated with Claude Code

… short operations

HBase computes MILLIS_BETWEEN_NEXTS as a sum of wall-clock millisecond
deltas between scanner creation and each scan RPC response. The global
metric tests scan 10 rows in one region, which takes one RPC. When that
RPC finishes within the same millisecond tick the sum is 0, so the
"> 0" checks fail intermittently on fast hosts. MUTATION_COMMIT_TIME is
also a wall-clock millisecond delta, and a commit of 10 small rows can
also finish within one tick.

Assert instead that the operation records each metric (sample count
> 0), and keep the strict checks on the other scan and mutation
metrics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the test-only timing-assertion changes.

No open issues 🎉

What changed in this PR

This test-only change addresses intermittent metric assertion failures on fast hosts by allowing valid zero-millisecond timings.

Changes:

  • Check recorded samples instead of positive values for scan intervals and mutation commit times.
  • Explain the timing resolution in comments; leave other metric checks unchanged.
File Description
phoenix-core/​src/​it/​java/​org/​apache/​phoenix/​monitoring/​PhoenixMetricsIT.java Updates four timing assertions across query, mutation, and upsert-select tests.

Review effort: Balanced

@apurtell

apurtell commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Precommit note: the failures in this run are not related to this change. Each one is a known problem on master.

(Claude Code)

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