-
Notifications
You must be signed in to change notification settings - Fork 935
Add priming logic to integration tests to avoid backend cold start issues. #1259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a before()
block like this run before the entire test suite or before every test?
import { EventsAccumulator } from './util/events_accumulator'; | ||
import { withTestDoc } from './util/helpers'; | ||
|
||
// Firestore databases can be subject to a ~30s "cold start" delay if they have not been used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Last week I added tslint enforcement of 100 (
"max-line-length": [true, {"limit": 100, "ignore-pattern": "https?://"}],
Yeah, A before() block outside the context of a describe() will run before all tests in all suites. |
Doesn't this mean we start a listener and do a transaction for every test then? It seems like if all we care about is "priming" then we should be able to run this once. Alternatively if test run times before and after are comparable then I guess it doesn't matter, but intuitively this seems like it could add up. |
Sorry, I was trying to describe when it runs, not how often... It'll only run once, regardless of how many tests are running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…sues. Port of firebase/firebase-js-sdk#1259 except I didn't use EventAccumulator since it hits the default timeout. I just manually do the listener.
…sues. (#1890) Port of firebase/firebase-js-sdk#1259 except I didn't use EventAccumulator since it hits the default timeout. I just manually do the listener.
…sues. (#50) Port of firebase/firebase-js-sdk#1259 except reworked to use listener since EventAccumulator doesn't accept arbitrary timeouts.
No description provided.