<commit_before>describe('e2-endpoint-reconnection-secure', function () {

  var spawn = require('child_process').spawn
    , sep = require('path').sep
    , remote
    , expect = require('expect.js')
    , mesh
    , Mesh = require('../')

  var libFolder = __dirname + sep + 'lib' + sep;

  var REMOTE_MESH = 'e2-remote-mesh-secure';

  var PORT_REMOTE = 3030;
  var PORT_LOCAL = 4040;

  var config = {
    name: 'e2-endpoint-reconnection',
    happn: {
      port: PORT_LOCAL,
      secure: true
    },
    endpoints: {
      'remoteMeshE2': {  // remote mesh node
        reconnect: {
          max: 2000, //we can then wait 10 seconds and should be able to reconnect before the next 10 seconds,
          retries: 100
        },
        config: {
          port: PORT_REMOTE,
          host: 'localhost',
          username: '_ADMIN',
          password: '<PASSWORD>'
        }
      }
    }
  };

  this.timeout(120000);

  //require('benchmarket').start();
  //after(//require('benchmarket').store());

  var startRemoteMesh = function (callback) {

    var timedOut = setTimeout(function () {
      callback(new Error('remote mesh start timed out'));
    }, 5000);

    // spawn remote mesh in another process
    remote = spawn('node', [libFolder + REMOTE_MESH]);

    remote.stdout.on('data', function (data) {

      //console.log('output:::', data.toString());

      if (data.toString().match(/READY/)) {

        clearTimeout(timedOut);

        setTimeout(function () {
          callback();
        }, 1000);
      }
    });
  };

  var beforeDoneCalled = false;

  before(function (done) {

    startRemoteMesh(function (e) {

      if (e) return done(e);<commit_msg>log remote<commit_after>describe('e2-endpoint-reconnection-secure', function () {

  var spawn = require('child_process').spawn
    , sep = require('path').sep
    , remote
    , expect = require('expect.js')
    , mesh
    , Mesh = require('../')

  var libFolder = __dirname + sep + 'lib' + sep;

  var REMOTE_MESH = 'e2-remote-mesh-secure';

  var PORT_REMOTE = 3030;
  var PORT_LOCAL = 4040;

  var config = {
    name: 'e2-endpoint-reconnection',
    happn: {
      port: PORT_LOCAL,
      secure: true
    },
    endpoints: {
      'remoteMeshE2': {  // remote mesh node
        reconnect: {
          max: 2000, //we can then wait 10 seconds and should be able to reconnect before the next 10 seconds,
          retries: 100
        },
        config: {
          port: PORT_REMOTE,
          host: 'localhost',
          username: '_ADMIN',
          password: '<PASSWORD>'
        }
      }
    }
  };

  this.timeout(120000);

  //require('benchmarket').start();
  //after(//require('benchmarket').store());

  var startRemoteMesh = function (callback) {

    var timedOut = setTimeout(function () {
      callback(new Error('remote mesh start timed out'));
    }, 5000);

    // spawn remote mesh in another process
    remote = spawn('node', [libFolder + REMOTE_MESH]);

    remote.stdout.on('data', function (data) {

      console.log('output:::', data.toString());

      if (data.toString().match(/READY/)) {

        clearTimeout(timedOut);

        setTimeout(function () {
          callback();
        }, 1000);
      }
    });
  };

  var beforeDoneCalled = false;

  before(function (done) {

    startRemoteMesh(function (e) {

      if (e) return done(e);
{'fraction_non_alphanumeric': 0.1462979482604817, 'fraction_numerical': 0.02200416294974725, 'mean_word_length': 2.311023622047244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5382031', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1012, 'n_words': 244}