public void send ( TestRun testRun ) { try { if ( isStarted ( ) ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; new JsonSerializer ( ) . serializePayload ( new OutputStreamWriter ( baos ) , testRun , false ) ; socket . emit ( "payload" , new String ( baos . toByteArray ( ) ) ) ; } else { LOGGER . log ( Level . WARNING , "Probe Dock RT is not available to send the test results" ) ; } } catch ( Exception e ) { LOGGER . log ( Level . WARNING , "Unable to send the result to the agent. Cause: " + e . getMessage ( ) ) ; if ( LOGGER . getLevel ( ) == Level . FINEST ) { LOGGER . log ( Level . FINEST , "Exception: " , e ) ; } } }
Send a test result to the agent . This is a best effort and when the request failed there is no crash