Giter Club home page Giter Club logo

Comments (10)

naz avatar naz commented on May 17, 2024

Have a suspicion the flakiness comes partially from compilation step. There's a value testing against compiled files as that's what gets distributed. That said, think we might benefit from running the coverage against unprocessed source as that's the real and less prone to flakiness source of truth.

Have you had any successful experiments around this issue @shadowgate15 ?

from bree.

naz avatar naz commented on May 17, 2024

I'm adding few tests to increase test coverage and hopefully make the build pass at lease on Node v10. It still puzzles me what's the main source of difference between test coverage in v10 vs v12

from bree.

naz avatar naz commented on May 17, 2024

The master is šŸŸ¢ again! Have added coverage and reworked how logger = _.cloneDeep(console) was used. The problem with cloning console is that it produces way to much junk output during the test run and was hiding the information about which test has caused an unhandled exception. Having explicit logger variable declarations also gives tests more readability imo.

from bree.

shadowgate15 avatar shadowgate15 commented on May 17, 2024

from bree.

naz avatar naz commented on May 17, 2024

@shadowgate15 is there a plan for this planned refactor somewhere? What is the goal that needs achieving through the refactor?

from bree.

shadowgate15 avatar shadowgate15 commented on May 17, 2024

from bree.

naz avatar naz commented on May 17, 2024

Sounds awesome. Having one giant test.js file was getting hard to reason about. Also would be good to clarify the cases when "serial" test cases should be used. My guess was they were made serial because of the flakiness?

from bree.

shadowgate15 avatar shadowgate15 commented on May 17, 2024

from bree.

shadowgate15 avatar shadowgate15 commented on May 17, 2024

So the flaky tests were coming from job terminates after closeWorkerAfterMs. Below is my attempt to fix but it is still messing up. any thoughts @naz @niftylettuce?

test.serial('job terminates after closeWorkerAfterMs', async (t) => {
  t.plan(2);

  const logger = {};
  logger.info = () => {};
  logger.error = () => {};

  const clock = FakeTimers.install({ now: Date.now() });

  const bree = new Bree({
    root,
    jobs: [{ name: 'long', closeWorkerAfterMs: 100 }]
    // Logger
  });

  bree.run('long');
  const start = clock.now;
  t.true(typeof bree.closeWorkerAfterMs.long === 'object');
  await delay(1);

  bree.workers.long.on('exit', (code) => {
    t.is(start + 100, clock.now);
    t.is(code, 1);
  });

  clock.runAll();
  clock.uninstall();
});

from bree.

niftylettuce avatar niftylettuce commented on May 17, 2024

all good now

from bree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.