Repository: kubeflow/pipelines

Issue:
[testing] v2 sample test failing at master
reported by @chensun at https://github.com/kubeflow/pipelines/pull/6804#issuecomment-952542710

UPDATE: after the investigations below, it seems to me that v2 sample test is not flaky, it's basically broken at master.
The error message is https://4e18c21c9d33d20f-dot-datalab-vm-staging.googleusercontent.com/#/runs/details/bea48911-71d1-42ee-9dca-530bfee1f08e
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.7/site-packages/kfp/__init__.py", line 23, in <module>
    from . import dsl
  File "/usr/local/lib/python3.7/site-packages/kfp/dsl/__init__.py", line 16, in <module>
    from ._pipeline import Pipeline, PipelineExecutionMode, pipeline, get_pipeline_conf, PipelineConf
  File "/usr/local/lib/python3.7/site-packages/kfp/dsl/_pipeline.py", line 22, in <module>
    from kfp.dsl import _component_bridge
  File "/usr/local/lib/python3.7/site-packages/kfp/dsl/_component_bridge.py", line 30, in <module>
    from kfp.dsl import component_spec as dsl_component_spec
  File "/usr/local/lib/python3.7/site-packages/kfp/dsl/component_spec.py", line 21, in <module>
    from kfp.v2.components.types import type_utils
  File "/usr/local/lib/python3.7/site-packages/kfp/v2/components/__init__.py", line 15, in <module>
    from kfp.v2.components.experimental.yaml_component import load_component_from_text
  File "/usr/local/lib/python3.7/site-packages/kfp/v2/components/experimental/yaml_component.py", line 16, in <module>
    from kfp.v2.components.experimental import base_component
  File "/usr/local/lib/python3.7/site-packages/kfp/v2/components/experimental/base_component.py", line 19, in <module>
    from kfp.v2.components.experimental import pipeline_task
  File "/usr/local/lib/python3.7/site-packages/kfp/v2/components/experimental/pipeline_task.py", line 21, in <module>
    from kfp.v2.components.experimental import pipeline_channel
  File "/usr/local/lib/python3.7/site-packages/kfp/v2/components/experimental/pipeline_channel.py", line 22, in <module>
    from kfp.v2.components.types.experimental import type_utils
ModuleNotFoundError: No module named 'kfp.v2.components.types.experimental'
F1027 12:43:37.163580       1 main.go:50] Failed to execute component: exit status 1
```


Discussion:
https://oss-prow.knative.dev/view/gs/oss-prow/pr-logs/pull/kubeflow_pipelines/6804/kubeflow-pipelines-v2-go-test/1453335007127932928 logs all look good, but the test failed.

EDIT: I was wrong, the unit test properly failed at line https://oss-prow.knative.dev/view/gs/oss-prow/pr-logs/pull/kubeflow_pipelines/6804/kubeflow-pipelines-v2-go-test/1453335007127932928#1:build-log.txt%3A44
Sending a blank PR to test presubmit test on master branch: https://github.com/kubeflow/pipelines/pull/6814

The blank PR also fails for v2 sample test, so v2 sample test is broken on master.
Updated what I found in [the issue body](https://github.com/kubeflow/pipelines/issues/6813#issue-1037358605).
There were some flakiness before the broken change was introduced, I'll investigate that separately at https://github.com/kubeflow/pipelines/issues/6815.
The last SDK related PR that got a passing v2 sample test was https://github.com/kubeflow/pipelines/pull/6472.
And there was only one SDK PR after that -- https://github.com/kubeflow/pipelines/pull/6803, which is most likely the PR that breaks master.

@chensun can you try to debug the error message?

I understand the frustration with flaky tests, eventually you will stop trusting a flaky test, that's the natural behavior. So it's a proof that the flakiness issue has been very adversely affecting productivity. I'll prioritize fixing it with @capri-xiyue .

Resolving patch:
diff --git a/sdk/python/setup.py b/sdk/python/setup.py
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -52,9 +52,9 @@
     'protobuf>=3.13.0,<4',
     'uritemplate>=3.0.1,<4',
     'pydantic>=1.8.2,<2',
+    'typer>=0.3.2,<1.0',
     # Standard library backports
     'dataclasses;python_version<"3.7"',
-    'typer>=0.3.2,<1.0',
     'typing-extensions>=3.7.4,<4;python_version<"3.9"',
 ]
 
@@ -118,6 +118,7 @@ def find_version(*file_path_parts):
         'kfp.v2.compiler',
         'kfp.v2.components',
         'kfp.v2.components.types',
+        'kfp.v2.components.types.experimental',
         'kfp.v2.components.experimental',
         'kfp.v2.dsl',
         'kfp.v2.google.client',


Test patch: