Reduce intermittent spec failures by making VueJS resource interceptor
decrement outstanding resource counts when HTTP response is received Before the count would be reduced 500 ms after a DOM update tick, which could cause race conditions since the `DatabaseCleaner` could run in the middle of a Rails controller handling the response. Partial fix to #21197 and other intermittent spec failures.
This commit is contained in:
parent
2aaab34b67
commit
924141fbfa
1 changed files with 3 additions and 6 deletions
|
@ -1,10 +1,7 @@
|
|||
Vue.http.interceptors.push((request, next) => {
|
||||
Vue.http.interceptors.push((request, next) => {
|
||||
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
|
||||
|
||||
Vue.nextTick(() => {
|
||||
setTimeout(() => {
|
||||
Vue.activeResources--;
|
||||
}, 500);
|
||||
next(function (response) {
|
||||
Vue.activeResources--;
|
||||
});
|
||||
next();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue