IndexedDB: Add tests that verify the source of IDBRequests #7680
IndexedDB: Add tests that verify the source of IDBRequests #7680inexorabletash merged 2 commits intoweb-platform-tests:masterfrom inexorabletash:idb-sources
Conversation
…y store/index/cursor methods
Build PASSEDStarted: 2017-10-17 22:10:02 Failing Jobs
Unstable ResultsBrowser: "Microsoftedge 14.14393" (failures allowed)View in: WPT PR Status | TravisCI
|
|
Weird... Edge will throw due to unsupported functions (getAll, getAllKeys, getKey/openKeyCursor on store)... but why is it flaky? And why is it hitting the 'open should succeed' error? Hrm... |
|
I've narrowed down the flakiness to what appears to be an Edge bug - cross-talk between operations on unrelated databases: function t(dbname) {
indexedDB.deleteDatabase(dbname).onsuccess = e => {
const open = indexedDB.open(dbname, 1);
open.onupgradeneeded = e => {
const db = open.result;
db.createObjectStore('store');
};
open.onerror = e => {
console.error('open should succeed');
};
open.onsuccess = e => {
console.log('open succeeded');
const db = open.result;
db.close();
indexedDB.deleteDatabase(dbname);
};
};
}
t('db1');
t('db2');The second open flakily succeeds or fails. |
|
/cc @nolanlawson |
|
I sent the repro to @aliams as well. In case it's not clear, the repro has nothing to do with the features under test here. It's an unfortunate coincidence. It likely causes flakiness in other tests on Edge, but it's worst here because these test bodies are effectively synchronous; the test steps don't need to wait for a request's response to come back, so the race is "lost" far more frequently than in the more common tests with an asynchronous request/response cycle. |
|
Hah, per @aliams - @nolanlawson discovered this issue 3 years ago: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/175642/ |
| store.put('value'); | ||
| store.openCursor().onsuccess = t.step_func(e => { | ||
| const cursor = e.target.result; | ||
| assert_equals(eval(expr).source, cursor, |
There was a problem hiding this comment.
nit: You could avoid eval here by having each string be a closure instead, and using toString() on the closure. To be clear, here's some incomplete code below.
[
cursor => { cursor.update(0) },
].forEach(fn ...
assert_equals(fn(cursor), cursor, `${fn}`.source ... })Same for the cases below.
|
@inexorabletash you planning to fix the not? |
|
Yeah, it's just been the weekend in this TZ and I'm OOO from work today. If anyone else wants to push a change to this PR and land I'd be okay with that, though. |
Missing coverage noted in w3c/IndexedDB#213
Verify the source property of requests returned by operations made against stores, indexes, and cursors.