Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Feb 11, 2025

What changes were proposed in this pull request?

This PR aims to fix CallerContext test by enabling hadoop.caller.context.enabled during tests.

Why are the changes needed?

This test case was disabled since Apache Spark 2.1.0 because CallerContext was supported since Apache Hadoop 2.8+.

We need to recover CallerContext test coverage.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the CIs.

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

No.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 (non-binding)

This will remove the need for the test helper I proposed on #49858. Thanks, @dongjoon-hyun !

@dongjoon-hyun
Copy link
Member Author

Thank you, @cnauroth !

if (CallerContext.callerContextEnabled) {
assert(s"SPARK_$context" === HadoopCallerContext.getCurrent.toString)
}
assert(s"SPARK_$context" === HadoopCallerContext.getCurrent.toString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider adding an assert-not-null like in the #49858 test? If this isn't working, or if someone disables it in pom.xml, then toString will cause NPE instead of an assertion failure message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPE is already enough to detect the failure. :)

@dongjoon-hyun
Copy link
Member Author

Could you review this when you have some time, @sunchao ?

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the ping @dongjoon-hyun

@dongjoon-hyun
Copy link
Member Author

Thank you so much, @sunchao !

dongjoon-hyun added a commit that referenced this pull request Feb 11, 2025
…op.caller.context.enabled`

### What changes were proposed in this pull request?

This PR aims to fix `CallerContext` test by enabling `hadoop.caller.context.enabled` during tests.

### Why are the changes needed?

This test case was disabled since Apache Spark 2.1.0 because `CallerContext` was supported since Apache Hadoop 2.8+.
- #15377

We need to recover `CallerContext` test coverage.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

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

No.

Closes #49893 from dongjoon-hyun/SPARK-51164.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit d07b560)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun
Copy link
Member Author

Merged to master/4.0/3.5.

Thank you again, @cnauroth and @sunchao .

@dongjoon-hyun dongjoon-hyun deleted the SPARK-51164 branch February 11, 2025 21:14
dongjoon-hyun added a commit that referenced this pull request Feb 11, 2025
…op.caller.context.enabled`

### What changes were proposed in this pull request?

This PR aims to fix `CallerContext` test by enabling `hadoop.caller.context.enabled` during tests.

### Why are the changes needed?

This test case was disabled since Apache Spark 2.1.0 because `CallerContext` was supported since Apache Hadoop 2.8+.
- #15377

We need to recover `CallerContext` test coverage.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

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

No.

Closes #49893 from dongjoon-hyun/SPARK-51164.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit d07b560)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@cnauroth
Copy link
Contributor

@dongjoon-hyun and @sunchao , FYI, this might need a small follow-up: #49898 . Thank you.

@dongjoon-hyun
Copy link
Member Author

Ack, @cnauroth .

@steveloughran
Copy link
Contributor

ok, so with this #49779 doesn't need the changes in the production code, it can just

  • rely on the context flag being set
  • skip the tests to unset it

happy

zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
…op.caller.context.enabled`

### What changes were proposed in this pull request?

This PR aims to fix `CallerContext` test by enabling `hadoop.caller.context.enabled` during tests.

### Why are the changes needed?

This test case was disabled since Apache Spark 2.1.0 because `CallerContext` was supported since Apache Hadoop 2.8+.
- apache#15377

We need to recover `CallerContext` test coverage.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

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

No.

Closes apache#49893 from dongjoon-hyun/SPARK-51164.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 9edaf80)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants