test_class.declarator: SYNC_TIMEOUT_MILLS = 500
test_class.modifier: private static final
test_class.original_string: private static final int SYNC_TIMEOUT_MILLS = 500;
test_class.type: int
test_class.var_name: SYNC_TIMEOUT_MILLS
test_class.file: server/src/test/java/io/spine/server/transport/memory/SingleThreadInMemSubscriberTest.java
test_class.identifier: SingleThreadInMemSubscriberTest
test_case.body: @Test
      @MuteLogging
      @DisplayName("not halt after observer throws an error")
      void recoverFromObserverError() throws InterruptedException {
          SingleThreadInMemSubscriber subscriber =
                  new SingleThreadInMemSubscriber(ChannelId.getDefaultInstance());
  
          ThrowingObserver throwingObserver = new ThrowingObserver();
          subscriber.addObserver(throwingObserver);
  
          Any id = Identifier.pack(newUuid());
          ExternalMessage externalMessage = ExternalMessage
                  .newBuilder()
                  .setId(id)
                  .build();
          subscriber.onMessage(externalMessage);
  
          waitForMessage();
  
          assertThat(throwingObserver.onNextCalled())
                  .isTrue();
  
          subscriber.removeObserver(throwingObserver);
  
          MemoizingObserver<ExternalMessage> memoizingObserver = new MemoizingObserver<>();
          subscriber.addObserver(memoizingObserver);
          subscriber.onMessage(externalMessage);
  
          waitForMessage();
  
          assertThat(memoizingObserver.firstResponse())
                  .isEqualTo(externalMessage);
      }
test_case.class_method_signature: SingleThreadInMemSubscriberTest.recoverFromObserverError()
test_case.full_signature: @Test @MuteLogging @DisplayName("not halt after observer throws an error") void recoverFromObserverError()
test_case.identifier: recoverFromObserverError
test_case.invocations: getDefaultInstance addObserver pack newUuid build setId newBuilder onMessage waitForMessage isTrue assertThat onNextCalled removeObserver addObserver onMessage waitForMessage isEqualTo assertThat firstResponse
test_case.modifiers: @Test @MuteLogging @DisplayName("not halt after observer throws an error")
test_case.parameters: ()
test_case.return: void
test_case.signature: void recoverFromObserverError()
focal_class.declarator: executor = Executors.newSingleThreadExecutor()
focal_class.modifier: private final
focal_class.original_string: private final ExecutorService executor = Executors.newSingleThreadExecutor();
focal_class.type: ExecutorService
focal_class.var_name: executor
focal_class.file: server/src/main/java/io/spine/server/transport/memory/SingleThreadInMemSubscriber.java
focal_class.identifier: SingleThreadInMemSubscriber
focal_class.interfaces: implements Logging
focal_class.class_method_signature: SingleThreadInMemSubscriber.SingleThreadInMemSubscriber(ChannelId id)
focal_class.full_signature:   SingleThreadInMemSubscriber(ChannelId id)
focal_class.identifier: SingleThreadInMemSubscriber
focal_class.parameters: (ChannelId id)
focal_class.signature:  SingleThreadInMemSubscriber(ChannelId id)
focal_class.class_method_signature: SingleThreadInMemSubscriber.onMessage(ExternalMessage message)
focal_class.full_signature: @SuppressWarnings("FutureReturnValueIgnored") // Error handling is done manually. @Override public void onMessage(ExternalMessage message)
focal_class.identifier: onMessage
focal_class.modifiers: @SuppressWarnings("FutureReturnValueIgnored") // Error handling is done manually. @Override public
focal_class.parameters: (ExternalMessage message)
focal_class.return: void
focal_class.signature: void onMessage(ExternalMessage message)
focal_class.class_method_signature: SingleThreadInMemSubscriber.logError(Throwable throwable, ExternalMessage message)
focal_class.full_signature: private @Nullable Void logError(Throwable throwable, ExternalMessage message)
focal_class.identifier: logError
focal_class.modifiers: private @Nullable
focal_class.parameters: (Throwable throwable, ExternalMessage message)
focal_class.return: Void
focal_class.signature: Void logError(Throwable throwable, ExternalMessage message)
focal_class.class_method_signature: SingleThreadInMemSubscriber.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.superclass: extends InMemorySubscriber
focal_method.body: @SuppressWarnings("FutureReturnValueIgnored") // Error handling is done manually.
      @Override
      public void onMessage(ExternalMessage message) {
          CompletableFuture.runAsync(() -> callObservers(message), executor)
                           .exceptionally(throwable -> logError(throwable, message));
      }
focal_method.class_method_signature: SingleThreadInMemSubscriber.onMessage(ExternalMessage message)
focal_method.full_signature: @SuppressWarnings("FutureReturnValueIgnored") // Error handling is done manually. @Override public void onMessage(ExternalMessage message)
focal_method.identifier: onMessage
focal_method.invocations: exceptionally runAsync callObservers logError
focal_method.modifiers: @SuppressWarnings("FutureReturnValueIgnored") // Error handling is done manually. @Override public
focal_method.parameters: (ExternalMessage message)
focal_method.return: void
focal_method.signature: void onMessage(ExternalMessage message)