@Override
    public FSDataInputStream open(Path f, int bufferSize) throws IOException {
        return createInputStream(() -> originalFs.open(f, bufferSize));
    }
@Test
    void testSlowInputStreamNotClosed() throws Exception {
        final File file = File.createTempFile("junit", null, tempFolder);
        createRandomContents(file, new Random(), 50);

        final LimitedConnectionsFileSystem fs =
                new LimitedConnectionsFileSystem(LocalFileSystem.getSharedInstance(), 1, 0L, 1000L);

        // some competing threads
        final WriterThread[] threads = new WriterThread[10];
        for (int i = 0; i < threads.length; i++) {
            Path path = new Path(File.createTempFile("junit", null, tempFolder).toURI());
            threads[i] = new WriterThread(fs, path, 1, Integer.MAX_VALUE);
        }

        // open the stream we test
        try (FSDataInputStream in = fs.open(new Path(file.toURI()))) {

            // start the other threads that will try to shoot this stream down
            for (WriterThread t : threads) {
                t.start();
            }

            // read the stream slowly.
            Thread.sleep(5);
            while (in.read() != -1) {
                Thread.sleep(5);
            }
        }

        // wait for clean shutdown
        for (WriterThread t : threads) {
            t.sync();
        }
    }