Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

sdk-testing assertj failure messages report the wrong value or type

Chiusa Adatta ai principianti
#8,866 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
testing

Direzione di ricerca

Inizia in sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ e ispeziona HistogramAssert, ExponentialHistogramAssert, MetricAssert e LogRecordDataAssert, usando LongSumAssert.isCumulative() come punto di confronto. Correggi i valori riportati, gli argomenti di formattazione e la formulazione descritti nell'issue, quindi esegui i test di sdk-testing e verifica che i messaggi di errore corrispondano al testo previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
Some opentelemetry-sdk-testing assertj failure messages report the wrong value or the wrong field. The pass/fail result is correct, but the message can mislead whoever reads the failing test log.

Steps to reproduce
Call assertThat(metric).hasHistogramSatisfying(h -> h.isCumulative()) on a metric whose histogram uses DELTA temporality.

What did you expect to see?
Expected Histogram to have cumulative aggregation but found <DELTA>, the same shape LongSumAssert.isCumulative() produces.

What did you see instead?
Expected Histogram to have cumulative aggregation but found <CUMULATIVE>. Five places under sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ are affected:

  • HistogramAssert.isCumulative(), isDelta() and ExponentialHistogramAssert.isDelta() pass the expected constant as an extra format argument, so %s prints the expected value instead of the actual one.
  • HistogramAssert.isDelta() also says "Histgram ... cumulative", and ExponentialHistogramAssert.isDelta() says "cumulative".
  • MetricAssert.hasInstrumentationScope() says "to have resource".
  • LogRecordDataAssert.hasSpanContext() says "span context <...> nanos".

What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-testing
Version: main @ ce32c1205
How did you reference these artifacts? N/A (repository source)

Environment
Compiler: Temurin 21
OS: N/A

Additional context
N/A

Lingua principale
Java
Stelle
2.5k
Fork
1k
Merge medio
2g 21h
PR unite (30g)
75

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-java

Tutte le issue di open-telemetry/opentelemetry-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.