Skip to content

[SPARK-55306][PYTHON][TESTS][FOLLOW-UP] Skip Kafka streaming RTM tests when dependencies are not installed#55270

Closed
zhengruifeng wants to merge 4 commits intoapache:masterfrom
zhengruifeng:SPARK-kafka-skip-test
Closed

[SPARK-55306][PYTHON][TESTS][FOLLOW-UP] Skip Kafka streaming RTM tests when dependencies are not installed#55270
zhengruifeng wants to merge 4 commits intoapache:masterfrom
zhengruifeng:SPARK-kafka-skip-test

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Skip StreamingKafkaTests in test_streaming_kafka_rtm.py when testcontainers or kafka-python is not installed, instead of raising an ImportError that crashes the entire test module.

Why are the changes needed?

The CI job pyspark-structured-streaming fails because test_streaming_kafka_rtm.py raises ImportError at module level when testcontainers is not installed. This causes the entire test runner to exit with a non-zero code, failing the CI build. See: https://github.com/apache/spark/actions/runs/24128422095/job/70399041605

Does this PR introduce any user-facing change?

No.

How was this patch tested?

The test class is now decorated with @unittest.skipIf(not have_kafka_deps, ...), which gracefully skips when the dependencies are missing — the same pattern used for Docker availability in the same file.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code

@zhengruifeng zhengruifeng changed the title [SPARK-XXXXX][PYTHON][TESTS] Skip Kafka streaming RTM tests when dependencies are not installed [SPARK-55306][PYTHON][TESTS][FOLLOW-UP] Skip Kafka streaming RTM tests when dependencies are not installed Apr 9, 2026
@viirya
Copy link
Copy Markdown
Member

viirya commented Apr 9, 2026

cc @jerrypeng

@HeartSaVioR
Copy link
Copy Markdown
Contributor

HeartSaVioR commented Apr 9, 2026

#55266

Can we check whether this PR is doing the same work with above?

@viirya
Copy link
Copy Markdown
Member

viirya commented Apr 9, 2026

This causes the entire test runner to exit with a non-zero code, failing the CI build. See: https://github.com/apache/spark/actions/runs/24128422095/job/70399041605

The PR added the test code passed all CIs. Is the failed pipeline not running on the PR?

@zhengruifeng
Copy link
Copy Markdown
Contributor Author

@HeartSaVioR just notice #55266, I think we don't need this PR now.

@viirya

Is the failed pipeline not running on the PR?

yes, it is failed on scheduled workflows.

@zhengruifeng zhengruifeng deleted the SPARK-kafka-skip-test branch April 9, 2026 05:31
@jerrypeng
Copy link
Copy Markdown
Contributor

yes, it is failed on scheduled workflows.

@zhengruifeng why would it succeed for PRs but fail for scheduled workflows?

@zhengruifeng
Copy link
Copy Markdown
Contributor Author

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.

4 participants