From 9b1e5805d98f8ee5538fb648ae7844060d7201f1 Mon Sep 17 00:00:00 2001
From: Andrew Nicols <andrew@nicols.co.uk>
Date: Fri, 29 Nov 2019 10:16:18 +0800
Subject: [PATCH] MDL-67656 behat: Removed nested spin

---
 lib/tests/behat/behat_general.php | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php
index 6bdfb857f9d..e3830b7dd91 100644
--- a/lib/tests/behat/behat_general.php
+++ b/lib/tests/behat/behat_general.php
@@ -1018,11 +1018,7 @@ EOF;
             // Using the spin method as we want a reduced timeout but there is no need for a 0.1 seconds interval
             // because in the optimistic case we will timeout.
             // If all goes good it will throw an ElementNotFoundExceptionn that we will catch.
-            $this->spin(
-                function($context, $args) use ($selectortype, $element) {
-                    return $this->find($selectortype, $element);
-                }, [], behat_base::get_reduced_timeout(), $exception, false
-            );
+            return $this->find($selectortype, $element, $exception, false, behat_base::get_reduced_timeout());
         } catch (ElementNotFoundException $e) {
             // We expect the element to not be found.
             return;