aglinxinyuan commented on code in PR #7119: URL: https://github.com/apache/texera/pull/7119#discussion_r3680899708
########## common/util/src/test/scala/org/apache/texera/common/util/RetryUtilSpec.scala: ########## @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.texera.common.util + +import org.apache.texera.common.util.RetryUtil.RetryAttempt +import org.scalatest.flatspec.AnyFlatSpec + +import scala.collection.mutable.ListBuffer +import scala.util.control.ControlThrowable + +/** + * Contract of the shared blocking backoff retry. `sleep` is injected everywhere so the backoff + * progression is asserted exactly without any test waiting. + * + * These cases are the union of what the two hand-rolled loops this util replaced were tested for + * (`LakeFSStorageClient.retryWithBackoff`, `FileService.awaitDependency`), plus the interrupt + * during a backoff sleep, which the LakeFS copy did not handle. + */ +class RetryUtilSpec extends AnyFlatSpec { + + private def noRetryHook: RetryAttempt => Unit = _ => () Review Comment: Renamed to `noopRetryHook` across all 8 sites — agreed that "no retry hook" reads exactly backwards in the two cases that are about not retrying. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
