Conversation
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
…js-bigquery into feat_sample_test_retries merging changes from remote
alvarowolfx
left a comment
There was a problem hiding this comment.
Added a comment on how to make retries more granular and efficient.
|
|
||
| describe('Authorized View Tutorial', () => { | ||
| describe('Authorized View Tutorial', function () { | ||
| this.retries(3); |
There was a problem hiding this comment.
I think doing this way, it will retry the whole describe section, which can be quite expensive to re run. I ran some tests here and seems like we can retry on a per spec basis.
describe('Authorized View Tutorial', () => { // Back to arrow function
beforeEach(function(){
console.log("this:", this.currentTest.title)
this.currentTest.retries(2); // will try 3 times - n+1
})
Then I changed one of the tests to fail, to check for the retry behavior:
it('should query stackoverflow', async () => {
const output = execSync('node queryStackOverflow.js');
assert.match(output, /Query Results:/);
assert.match(output, /views/);
assert.match(0,1)
}); // Force failure
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1299 🦕