-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
test_runner: fix concurrent describe
queuing
#43998
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,17 +149,6 @@ describe('level 0a', { concurrency: 4 }, () => { | |
return p0a; | ||
}); | ||
|
||
describe('top level', { concurrency: 2 }, () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the fact this test worked until this PR is a bug:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope my explanation of what is going on os fine, it took me a while to understand it myself |
||
it('+long running', async () => { | ||
return new Promise((resolve, reject) => { | ||
setTimeout(resolve, 3000).unref(); | ||
}); | ||
}); | ||
|
||
describe('+short running', async () => { | ||
it('++short running', async () => {}); | ||
}); | ||
}); | ||
|
||
describe('invalid subtest - pass but subtest fails', () => { | ||
setImmediate(() => { | ||
|
@@ -339,3 +328,47 @@ describe('timeouts', () => { | |
setTimeout(done, 10); | ||
}); | ||
}); | ||
|
||
describe('successful thenable', () => { | ||
it('successful thenable', () => { | ||
let thenCalled = false; | ||
return { | ||
get then() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly personally I think anything related to non-native promises isn't important to even test or support anymore probably :D? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #43998. |
||
if (thenCalled) throw new Error(); | ||
thenCalled = true; | ||
return (successHandler) => successHandler(); | ||
}, | ||
}; | ||
}); | ||
|
||
it('rejected thenable', () => { | ||
let thenCalled = false; | ||
return { | ||
get then() { | ||
if (thenCalled) throw new Error(); | ||
thenCalled = true; | ||
return (_, errorHandler) => errorHandler(new Error('custom error')); | ||
}, | ||
}; | ||
}); | ||
|
||
let thenCalled = false; | ||
return { | ||
get then() { | ||
if (thenCalled) throw new Error(); | ||
thenCalled = true; | ||
return (successHandler) => successHandler(); | ||
}, | ||
}; | ||
}); | ||
|
||
describe('rejected thenable', () => { | ||
let thenCalled = false; | ||
return { | ||
get then() { | ||
if (thenCalled) throw new Error(); | ||
thenCalled = true; | ||
return (_, errorHandler) => errorHandler(new Error('custom error')); | ||
}, | ||
}; | ||
}); |
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.
I'd personally prefer an async iife