I'm currently testing a performance package I wrote, which relies on node:perf_hooks. Specifically the performance.mark() and performance.measure() methods. I am collecting metrics which I'm monitoring in specific, configurable time intervals and now would like to test whether the collection of the metrics is working correctly. For that I want to simulate the recording of values through simply calling the performance.measure() and performance.mark() methods with dummy data, then elapsing the time of the interval using fakeTimers and simply checking if the marks and measures were correctly recorded for each metric and then checking that these metrics were indeed collected. However, when I call the mark() and measure() methods in conjunction with using fakeTimers, perf_hooks complains about the timestamp being negative. Does anyone know how to resolve this? I tried passing a configuration to fakeTimers in which I set 'now' to the highest possible value - with no effect whatsoever. Help is much appreciated!
Negative timestamp using sinon fakeTimers when testing node:perf_hooks
98 Views Asked by gandelino At
0
There are 0 best solutions below
Related Questions in NODE.JS
- How to solve CERT_UNTRUSTED error in nodemailer
- Run a loop over a callback, node js
- Implementing prerender.io middleware in sails.js
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- formatting path string in javascript
- One to One screensharing using WEBRTC
- Create polygon from grid (for collisions)
- Strange npm behavior when installing packages like grunt
- Convert JSON.gz to JSON in node js
- "Your npm version is outdated." but it's not. While install yo
- Why put methods on the prototype of a class instead of declaring them in the constructor?
- Node JS Async Response
- mongoose get property from nested schema after `group`
- Cannot Receive Incoming call on Twilio android Client
- How can I change a specific line in a file with node js?
Related Questions in TESTING
- How does Robot's Telnet library work?
- Behat doesn't load extensions?
- Load additional CONFIG file with values
- rails controller test failing non-deterministicly wrt state leak (I think)
- Ordering tests using trial twisted
- Unexcepted failed Gavel/Dredd test
- How to use Jasmine and CucumberJS with Protractor
- Django login tests session problems
- How to mock specific RequireJs dependencies while unit testing
- Test case for WCF REST Service
- how to test this business logic
- Protractor - How to get first or last CHILD value
- Factory Not Registered in rspec but found in console
- Pick out certain lines from files
- Selenium stops running after click() function runs
Related Questions in SINON-CHAI
- Has been called with object assertion
- How to check wether $interval is called with exact arguments or not in sinon.js
- Sinon calledWith and calledWithMatch fail for objects EDIT: Sinon spy on object constructor
- Chai + Sinon error: method is already wrapped
- chai and sinon test does not fail but it should
- Negative timestamp using sinon fakeTimers when testing node:perf_hooks
- The catch-block doesn't catch throw method of a stub
- mocha uncovered lines data loading problem
- Can't mock/stub knex methods
- How do I unit test using sinon?
- How to assert sinon .stub called
- Mock Jquery event using Sinon.js
- REST API unit test with promise return in nodejs
- stub never called with sinon and nodejs using chai-as-promised
- Can I make a stub for a range of outcomes? "sinon.stub().callsFake(()=>{})" AssertionError: NaN
Related Questions in USEFAKETIMERS
- async http request breaks fake-timers
- Negative timestamp using sinon fakeTimers when testing node:perf_hooks
- TypeError: Cannot assign to read only property 'performance' of object '[object global]'
- Timeout simulation not working with testing-library and useFakeTimers
- Why is faketime command skipping section of code
- Test gets stuck when using jest.useFakeTimers() during a database async operation
- How to make jest fake timers work with asynchronous functions in jest/react?
- Sinon fake timers and syncing ticks with unpredictable timers to guarantee order of execution
- Why is the behavior of `jest.useFakeTimers` different when called inside vs. outside of `beforeEach` in React Native
- How to write a test case for this function in jest
- Testing with Jest FakeTimers
- Using Jest with setTimeout and useFakeTimers
- jest.UseFakeTimers() / jestjest.runAllTimers() don't work
- How to assert on callback when using jest.useFakeTimers
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?