MCPcopy Create free account
hub / github.com/apache/thrift / checkOffByOne

Function checkOffByOne

lib/nodejs/test/test_driver.mjs:312–349  ·  view source on GitHub ↗
(done, callback)

Source from the content-addressed store, hash-verified

310}
311
312function checkOffByOne(done, callback) {
313 const retry_limit = 30;
314 const retry_interval = 100;
315 let test_complete = false;
316 let retrys = 0;
317
318 /**
319 * redo a simple test after the oneway to make sure we aren't "off by one" --
320 * if the server treated oneway void like normal void, this next test will
321 * fail since it will get the void confirmation rather than the correct
322 * result. In this circumstance, the client will throw the exception:
323 *
324 * Because this is the last test against the server, when it completes
325 * the entire suite is complete by definition (the tests run serially).
326 */
327 done(function () {
328 test_complete = true;
329 });
330
331 //We wait up to retry_limit * retry_interval for the test suite to complete
332 function TestForCompletion() {
333 if (test_complete && callback) {
334 callback("Server successfully tested!");
335 } else {
336 if (++retrys < retry_limit) {
337 setTimeout(TestForCompletion, retry_interval);
338 } else if (callback) {
339 callback(
340 "Server test failed to complete after " +
341 (retry_limit * retry_interval) / 1000 +
342 " seconds",
343 );
344 }
345 }
346 }
347
348 setTimeout(TestForCompletion, retry_interval);
349}
350
351function makeUnorderedDeepEqual(assert) {
352 return function (actual, expected, name) {

Callers 2

ThriftTestDriverFunction · 0.70
ThriftTestDriverPromiseFunction · 0.70

Calls 1

doneFunction · 0.85

Tested by

no test coverage detected