wyhaines / opentelemetry-api.cr

The core of open telemetry instrumentation is the OpenTelemetry API/SDK. The initial aim of this shard is to implement the OpenTelemetry specification for metrics, traces, and logs.
Apache License 2.0
12 stars 1 forks source link

Specs are failing on github CI but not on my local machine. #14

Closed wyhaines closed 2 years ago

wyhaines commented 2 years ago
Failures:

  1) OpenTelemetry::Span can set a span to all of the defined span kinds

       unexpected token '<EOF>' at line 1, column 1 (JSON::ParseException)
         from /usr/share/crystal/src/json/parser.cr:125:5 in 'parse_exception'
         from /usr/share/crystal/src/json/parser.cr:121:5 in 'unexpected_token'
         from /usr/share/crystal/src/json/parser.cr:37:7 in 'parse_value'
         from /usr/share/crystal/src/json/parser.cr:13:12 in 'parse'
         from /usr/share/crystal/src/json.cr:135:5 in 'parse'
         from spec/span_spec.cr:97:7 in '->'
         from /usr/share/crystal/src/spec/example.cr:[45](https://github.com/wyhaines/opentelemetry-api.cr/runs/6630367524?check_suite_focus=true#step:5:46):13 in 'internal_run'
         from /usr/share/crystal/src/spec/example.cr:33:16 in 'run'
         from /usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from /usr/share/crystal/src/spec/context.cr:339:7 in 'run'
         from /usr/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from /usr/share/crystal/src/spec/context.cr:156:7 in 'run'
         from /usr/share/crystal/src/spec/dsl.cr:220:7 in '->'
         from /usr/share/crystal/src/crystal/at_exit_handlers.cr:14:19 in 'run'
         from /usr/share/crystal/src/crystal/main.cr:[50](https://github.com/wyhaines/opentelemetry-api.cr/runs/6630367524?check_suite_focus=true#step:5:51):5 in 'exit'
         from /usr/share/crystal/src/crystal/main.cr:45:5 in 'main'
         from /usr/share/crystal/src/crystal/main.cr:127:3 in 'main'
         from /lib/x86_[64](https://github.com/wyhaines/opentelemetry-api.cr/runs/6630367524?check_suite_focus=true#step:5:65)-linux-gnu/libc.so.6 in '__libc_start_main'
         from /github/home/.cache/crystal/crystal-run-spec.tmp in '_start'
         from ???

Finished in 1.39 seconds
125 examples, 0 failures, 1 errors, 0 pending

Failed examples:

crystal spec spec/span_spec.cr:82 # OpenTelemetry::Span can set a span to all of the defined span kinds

This doesn't happen when I run specs locally. 🤔

wyhaines commented 2 years ago

This should be resolved. The problem was that with a different order of spec execution, and with insufficient protection of the OpenTelemetry configuration, a spec that was assuming things about the otel config was getting ran with a config different from what was assumed.

A method has been added to the spec helper that can be used to run specs inside a block. Any changes that happen to the config inside the block are cleaned up after the block runs.

The specs should be modified to use this everwhere, but that will be a separate issue.