KubernetesInternalRuntime extends InternalRuntime<KubernetesRuntimeContext<E>> { @Override protected void markStopped() throws InfrastructureException { machines.remove(getContext().getIdentity()); runtimeStates.remove(getContext().getIdentity()); } @Inject  KubernetesInternalRuntime(
      @Named("che.infra.kubernetes.workspace_start_timeout_min") int workspaceStartTimeoutMin,
      @Named("che.infra.kubernetes.ingress_start_timeout_min") int ingressStartTimeoutMin,
      NoOpURLRewriter urlRewriter,
      UnrecoverablePodEventListenerFactory unrecoverableEventListenerFactory,
      ServersCheckerFactory serverCheckerFactory,
      WorkspaceVolumesStrategy volumesStrategy,
      ProbeScheduler probeScheduler,
      WorkspaceProbesFactory probesFactory,
      RuntimeEventsPublisher eventPublisher,
      KubernetesSharedPool sharedPool,
      KubernetesRuntimeStateCache runtimeStates,
      KubernetesMachineCache machines,
      StartSynchronizerFactory startSynchronizerFactory,
      Set<InternalEnvironmentProvisioner> internalEnvironmentProvisioners,
      KubernetesEnvironmentProvisioner<E> kubernetesEnvironmentProvisioner,
      SidecarToolingProvisioner<E> toolingProvisioner,
      RuntimeHangingDetector runtimeHangingDetector,
      PreviewUrlCommandProvisioner previewUrlCommandProvisioner,
      SecretAsContainerResourceProvisioner secretAsContainerResourceProvisioner,
      KubernetesServerResolverFactory kubernetesServerResolverFactory,
      RuntimeCleaner runtimeCleaner,
      CheNamespace cheNamespace,
      Tracer tracer,
      @Assisted KubernetesRuntimeContext<E> context,
      @Assisted KubernetesNamespace namespace); void scheduleRuntimeStateChecks(); CompletableFuture<Void> waitRunningAsync(
      List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine); @Override Map<String, ? extends KubernetesMachineImpl> getInternalMachines(); @Override List<? extends Command> getCommands(); @Override Map<String, String> getProperties(); @Override WorkspaceStatus getStatus(); void scheduleServersCheckers(); boolean isConsistent();  }
@Test public void shouldRemoveRuntimeStateOnMarkingRuntimeStopped() throws Exception { runtimeStatesCache.putIfAbsent( new KubernetesRuntimeState( internalRuntime.getContext().getIdentity(), WorkspaceStatus.STOPPING, emptyList())); internalRuntime.markStopped(); assertFalse(runtimeStatesCache.get(internalRuntime.getContext().getIdentity()).isPresent()); }