Summary
test_cli_apply_duplicated_featureview_names is intermittently failing in CI (observed on parallel pytest-xdist workers):
FAILED sdk/python/tests/unit/cli/test_cli_apply_duplicates.py::test_cli_apply_duplicated_featureview_names
AssertionError: assert (-1 != 0 and b'Feature view names must be case-insensitively unique' in b'')
The return code -1 and empty output b'' indicate the subprocess timed out and was killed before producing any output.
Root Cause
Duplicate feature view name detection happens too late in the pipeline — inside store.plan() / store.apply() via _validate_feature_views() in feature_store.py. By that point, FeatureStore and its dependencies (Dask, registry, provider) have already been initialized.
The call chain is:
- CLI
apply_total_command calls apply_total(), which calls _get_repo_contents() (parses repo), then _get_store_and_registry() (creates FeatureStore), then apply_total_with_repo_instance(), then store.plan(), then _validate_all_feature_views(), which finally raises ConflictingFeatureViewNames.
- The CLI only catches
FeastProviderLoginError, so ConflictingFeatureViewNames propagates as an unhandled exception (raw traceback).
- During process shutdown, slow atexit handlers (Dask thread pool, PySpark JVM) can block indefinitely.
- The test helper
CliRunner.run_with_output() has a 60s timeout — when exceeded, it sends SIGKILL and the output is lost.
This creates two compounding problems:
- The error is raised too late — after heavy initialization that can trigger slow cleanup on exit
- The CLI does not handle the error — producing a traceback instead of a clean message, and not exiting promptly
Proposed Fix
-
Detect duplicate names at parse time in parse_repo() (repo_operations.py): Track feature view names (across FeatureView, BatchFeatureView, StreamFeatureView, OnDemandFeatureView) and data source names during collection. Raise ConflictingFeatureViewNames / DataSourceRepeatNamesException immediately when a collision is found — before FeatureStore or any heavy dependencies are initialized.
-
Catch FeastError in CLI plan/apply commands (cli/cli.py): Add except FeastError handlers (after the existing FeastProviderLoginError handler) to print a clean error message and exit with code 1, instead of letting validation errors propagate as unhandled tracebacks.
Environment
- Observed on macOS CI runners with pytest-xdist parallel execution ([gw2])
- Python 3.11.9
Affected Tests
test_cli_apply_duplicated_featureview_names
test_cli_apply_duplicate_data_source_names (same pattern, same risk)
test_cli_apply_duplicated_featureview_names_multiple_py_files (same pattern, same risk)
Summary
test_cli_apply_duplicated_featureview_namesis intermittently failing in CI (observed on parallel pytest-xdist workers):The return code
-1and empty outputb''indicate the subprocess timed out and was killed before producing any output.Root Cause
Duplicate feature view name detection happens too late in the pipeline — inside
store.plan()/store.apply()via_validate_feature_views()infeature_store.py. By that point,FeatureStoreand its dependencies (Dask, registry, provider) have already been initialized.The call chain is:
apply_total_commandcallsapply_total(), which calls_get_repo_contents()(parses repo), then_get_store_and_registry()(creates FeatureStore), thenapply_total_with_repo_instance(), thenstore.plan(), then_validate_all_feature_views(), which finally raisesConflictingFeatureViewNames.FeastProviderLoginError, soConflictingFeatureViewNamespropagates as an unhandled exception (raw traceback).CliRunner.run_with_output()has a 60s timeout — when exceeded, it sends SIGKILL and the output is lost.This creates two compounding problems:
Proposed Fix
Detect duplicate names at parse time in
parse_repo()(repo_operations.py): Track feature view names (across FeatureView, BatchFeatureView, StreamFeatureView, OnDemandFeatureView) and data source names during collection. RaiseConflictingFeatureViewNames/DataSourceRepeatNamesExceptionimmediately when a collision is found — before FeatureStore or any heavy dependencies are initialized.Catch
FeastErrorin CLI plan/apply commands (cli/cli.py): Addexcept FeastErrorhandlers (after the existingFeastProviderLoginErrorhandler) to print a clean error message and exit with code 1, instead of letting validation errors propagate as unhandled tracebacks.Environment
Affected Tests
test_cli_apply_duplicated_featureview_namestest_cli_apply_duplicate_data_source_names(same pattern, same risk)test_cli_apply_duplicated_featureview_names_multiple_py_files(same pattern, same risk)