Flaky test: test_cli_apply_duplicated_featureview_names fails with empty output on subprocess timeout
#6417 opened on May 19, 2026
Description
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_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. - The CLI only catches
FeastProviderLoginError, soConflictingFeatureViewNamespropagates 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. 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
- Observed on macOS CI runners with pytest-xdist parallel execution ([gw2])
- Python 3.11.9
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)