Support for asynchronous functions, and skipping individual runs#3
Open
jdmarshall wants to merge 2 commits intonowells:masterfrom
Open
Support for asynchronous functions, and skipping individual runs#3jdmarshall wants to merge 2 commits intonowells:masterfrom
jdmarshall wants to merge 2 commits intonowells:masterfrom
Conversation
Not all code that needs benchmarks is synchronous.
This will mostly be useful for adding benchmarks that cover features that only exist in certain versions. However it was first conceived when trying to write tests for cluster mode, where you only want the child process to run the same tests as the parent process is currently running.
Author
|
Reference siimon/prom-client#680 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes came about as a result of trying and failing to write benchmarks for parts of prom-client that did not have coverage.
Getting async to work was tricky. Getting benchmark-regression to successfully run in a child process was a slog. The setup
function cannot decide to run only a particular version because it doesn't have any access to that information due to how setup() was implemented outside the normal benchmark.js lifecycle (presumably to support async setup and teardown functions).
This change makes it work well enough to do what I wanted.
In writing it I realized that it would also be useful for anyone writing a benchmark for a function that is missing or broken in one of the versions they are testing. Being able to skip one but keep the others seems useful to me.