@Override
    void releaseAllResources() throws IOException {
        if (!isReleased) {
            isReleased = true;

            ResultSubpartitionView view = subpartitionView;
            if (view != null) {
                view.releaseAllResources();
                subpartitionView = null;
            }
        }
    }
@Test
    void testUnblockReleasedChannel() throws Exception {
        SingleInputGate inputGate = createSingleInputGate(1);
        LocalInputChannel localChannel =
                createLocalInputChannel(inputGate, new ResultPartitionManager());

        localChannel.releaseAllResources();
        assertThatThrownBy(localChannel::resumeConsumption)
                .isInstanceOf(IllegalStateException.class);
    }