Skip to content

Conversation

@ankitkumarsingh1702
Copy link

Summary

This PR fixes the failing tests in flytestdlib as reported in #6856.

Changes Made

1. Fix OpenTelemetry Schema URL Conflict (otelutils/factory.go)

Problem: TestRegisterTracerProviderWithContext was failing with:

conflicting Schema URL: https://opentelemetry.io/schemas/1.34.0 and https://opentelemetry.io/schemas/1.24.0

Solution: Changed resource.NewWithAttributes() to resource.NewSchemaless() to avoid schema URL conflicts when merging resources with resource.Default().

2. Fix Flaky Config Accessor Test (config/tests/accessor_test.go)

Problem: TestAccessor_UpdateConfig/[Viper]_Change_handler_k8s_configmaps was failing on macOS because fsnotify doesn't reliably detect symlink changes on Darwin systems.

Solution:

  • Added t.Skip() for macOS systems since this is a known limitation of fsnotify with symlinks
  • Improved the test with a polling mechanism instead of a fixed sleep for more robust behavior on non-macOS platforms

Testing

All tests pass:

go test ./...

Labels

  • fixed

Fixes #6856

- Fix OpenTelemetry schema URL conflict in otelutils/factory.go by using
  resource.NewSchemaless() instead of resource.NewWithAttributes() to avoid
  schema version mismatch between resource.Default() and semconv/v1.26.0

- Skip TestAccessor_UpdateConfig k8s_configmaps test on macOS as fsnotify
  doesn't reliably detect symlink changes on Darwin systems. Also improved
  the test with a polling mechanism for more robust behavior on other platforms.

Fixes: flyteorg#6856
Signed-off-by: Ankit Kumar Singh <ankitkumarsingh1702@gmail.com>
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.96%. Comparing base (4399ba8) to head (3f2a742).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6876   +/-   ##
=======================================
  Coverage   56.95%   56.96%           
=======================================
  Files         929      929           
  Lines       58151    58150    -1     
=======================================
+ Hits        33120    33124    +4     
+ Misses      21989    21984    -5     
  Partials     3042     3042           
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (ø)
unittests-flyteadmin 53.14% <ø> (+0.03%) ⬆️
unittests-flytecopilot 43.06% <ø> (ø)
unittests-flytectl 64.02% <ø> (ø)
unittests-flyteidl 75.71% <ø> (ø)
unittests-flyteplugins 60.13% <ø> (ø)
unittests-flytepropeller 53.63% <ø> (ø)
unittests-flytestdlib 63.26% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@ankitkumarsingh1702
Copy link
Author

Closing this PR as it targets master. Will create a new PR targeting v2 branch as requested by @machichima.

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.

[v2] Fix test failure in flytestdlib

1 participant