Skip to content

Commit

Permalink
m1 build fixes (#7720)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Nov 8, 2021
1 parent 0b9b8ba commit 4a5751a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

Expand All @@ -18,6 +17,7 @@
import io.airbyte.commons.concurrency.VoidCallable;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;

Expand All @@ -38,15 +38,18 @@ void testFromIterator() throws Exception {

@Test
void testFromStream() throws Exception {
final Stream<String> stream = spy(Stream.of("a", "b", "c"));
final AtomicBoolean isClosed = new AtomicBoolean(false);
final Stream<String> stream = Stream.of("a", "b", "c");
stream.onClose(() -> isClosed.set(true));

final AutoCloseableIterator<String> iterator = AutoCloseableIterators.fromStream(stream);

assertNext(iterator, "a");
assertNext(iterator, "b");
assertNext(iterator, "c");
iterator.close();

verify(stream).close();
assertTrue(isClosed.get());
}

private void assertNext(final Iterator<String> iterator, final String value) {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.build-m1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
build:
dockerfile: Dockerfile
args:
ARCH: ${DOCKER_BUILD_ARCH}
DOCKER_BUILD_ARCH: ${DOCKER_BUILD_ARCH}
JDK_VERSION: ${JDK_VERSION}
context: airbyte-workers
labels:
Expand Down

0 comments on commit 4a5751a

Please sign in to comment.