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
105 Views Asked by gandelino At
0
There are 0 best solutions below
Related Questions in NODE.JS
- Using Puppeteer to scrape a public API only when the data changes
- How to request administrator rights?
- How do I link two models in mongoose?
- Variable inside a Variable, not updating
- Unable to Post Form Data to MongoDB because of picturepath
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How to change the Font Weight of a SelectValue component in React when a SelectItem is selected?
- My unban and ban commands arent showing when i put the slash
- how to make read only file/directory in Mac writable
- How can I outsource worker processes within a for loop?
- Get remote MKV file metadata using nodejs
- Adding google-profanity-words to web page
- Products aren't displayed after fetching data from mysql db (node.js & express)
Related Questions in TESTING
- Using ES Modules with TS, and Jest testing(cannot use import statement outside module)
- Mocking AmazonS3 listObjects function in scala
- How to refer to the filepath of test data in test sourcecode?
- No tests found for given includes: [com.bright.TwitterAnalog.AuthenticationControllerSpec.Register user with valid request](--tests filter)
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- How to use Mockito for WebClient get call?
- Jest + JavaScript ES Modules
- How to configure api http request with load testing
- How can I make asserts on outbound HTTP requests?
- higher coefficient of determination values in the testing phase compared to the training phase
- Writing test methods with shared expensive set-up
- Slow performance when testing non-local IP services with Playwright
- uiState not updating in Tests
- Incorrect implementation of calloc() introduces division by zero and how to detect it via testing?
- How to test Creating and Cancelling Subscription in ThriveCart in Test Mode
Related Questions in SINON-CHAI
- Sinon assertions on chained method calls
- why could be my mock of dynamodb scanCommand with aws-sdk-client-mock is returning undefined?
- Node js Express Sinon Spy Stub Mock Question
- Can't mock/stub knex methods
- mocha uncovered lines data loading problem
- The catch-block doesn't catch throw method of a stub
- Negative timestamp using sinon fakeTimers when testing node:perf_hooks
- How to mock WebdriverIO.Element with sinon-chai
- Testing promise result when result property is randomly generated
- Inspect Chai Assertion error returning [Object] [Object]
- Using sinon to test if a function is being called on LitElement object
- Testing arguments of first call with Sinon/Chai
- Sinon cannot stub non-existent own property 'function'
- How can I test a constant value with mocha, chai, sinon?
- Cypress: assert argument of stubbed function with Regex
Related Questions in USEFAKETIMERS
- TypeError: Cannot assign to read only property 'performance' of object '[object global]'
- Negative timestamp using sinon fakeTimers when testing node:perf_hooks
- async http request breaks fake-timers
- Using Jest with setTimeout and useFakeTimers
- Testing with Jest FakeTimers
- Test gets stuck when using jest.useFakeTimers() during a database async operation
- How to write a test case for this function in jest
- jest.UseFakeTimers() / jestjest.runAllTimers() don't work
- Why is the behavior of `jest.useFakeTimers` different when called inside vs. outside of `beforeEach` in React Native
- Timeout simulation not working with testing-library and useFakeTimers
- Sinon fake timers and syncing ticks with unpredictable timers to guarantee order of execution
- How to make jest fake timers work with asynchronous functions in jest/react?
- Why is faketime command skipping section of code
- 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 # Hahtags
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?