Skip to content

Commit

Permalink
[SPARK-51033][CORE][TESTS] Fix CryptoStreamUtilsSuite to use `sameE…
Browse files Browse the repository at this point in the history
…lements` for array comparison

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

This PR aims to fix `CryptoStreamUtilsSuite` to use `sameElements` for array comparison.

### Why are the changes needed?

Since the existing assertion is invalid due to `String != Array[Byte]` comparison, it causes a compilation error from Scala 2.13.16.

https://github.com/apache/spark/blob/6bbfa2dad8c70b94ca52eb7cddde5ec68efbe0b1/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala#L115

- #49478

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

No, this is a test-only fix.

### How was this patch tested?

Pass the CIs.

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

No.

Closes #49727 from dongjoon-hyun/SPARK-51033.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
dongjoon-hyun committed Jan 29, 2025
1 parent 339b036 commit 5cce6e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CryptoStreamUtilsSuite extends SparkFunSuite {
bytes.toByteArray()
}.collect()(0)

assert(content != encrypted)
assert(!content.getBytes(UTF_8).sameElements(encrypted))

val in = CryptoStreamUtils.createCryptoInputStream(new ByteArrayInputStream(encrypted),
sc.conf, SparkEnv.get.securityManager.getIOEncryptionKey().get)
Expand Down

0 comments on commit 5cce6e9

Please sign in to comment.