From a9e79a41ee19258e5eb8da74bef4b8af9a2ccb95 Mon Sep 17 00:00:00 2001
From: Tathagata Das <tathagata.das1565@gmail.com>
Date: Tue, 18 Oct 2016 02:29:55 -0700
Subject: [PATCH] [SQL][STREAMING][TEST] Follow up to remove Option.contains
 for Scala 2.10 compatibility

## What changes were proposed in this pull request?

Scala 2.10 does not have Option.contains, which broke Scala 2.10 build.

## How was this patch tested?
Locally compiled and ran sql/core unit tests in 2.10

Author: Tathagata Das <tathagata.das1565@gmail.com>

Closes #15531 from tdas/metrics-flaky-test-fix-1.
---
 .../scala/org/apache/spark/sql/streaming/StreamTest.scala     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala
index 254f823bf5..8dfeb8da4b 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala
@@ -216,7 +216,9 @@ trait StreamTest extends QueryTest with SharedSQLContext with Timeouts {
       }
     }
 
-    def isStreamWaitingAt(time: Long): Boolean = synchronized { waitStartTime.contains(time) }
+    def isStreamWaitingAt(time: Long): Boolean = synchronized {
+      waitStartTime == Some(time)
+    }
   }
 
 
-- 
GitLab