Search in sources :

Example 1 with ServerDisconnectException

use of io.questdb.network.ServerDisconnectException in project questdb by bluestreak01.

the class RetryIODispatcherTest method testFailsWhenInvalidDataImportedLoop.

@Test
public void testFailsWhenInvalidDataImportedLoop() throws Exception {
    for (int i = 0; i < 5; i++) {
        System.out.println("*************************************************************************************");
        System.out.println("**************************         Run " + i + "            ********************************");
        System.out.println("*************************************************************************************");
        testImportWaitsWhenWriterLocked(new HttpQueryTestBuilder().withTempFolder(temp).withWorkerCount(2).withHttpServerConfigBuilder(new HttpServerConfigurationBuilder()).withCustomTextImportProcessor(((configuration, engine, workerCount) -> new TextImportProcessor(engine) {

            @Override
            public void onRequestRetry(HttpConnectionContext context) throws ServerDisconnectException {
                throw ServerDisconnectException.INSTANCE;
            }
        })), 0, ValidImportRequest, ValidImportResponse, false, true);
        temp.delete();
        temp.create();
    }
}
Also used : ServerDisconnectException(io.questdb.network.ServerDisconnectException) TextImportProcessor(io.questdb.cutlass.http.processors.TextImportProcessor) Test(org.junit.Test)

Aggregations

TextImportProcessor (io.questdb.cutlass.http.processors.TextImportProcessor)1 ServerDisconnectException (io.questdb.network.ServerDisconnectException)1 Test (org.junit.Test)1