Skip to content

Commit 4b43091

Browse files
diningPhilosopher64Prabhakar Kumar
authored andcommitted
Fixes sporadic JavaScript test failure.
1 parent 1d6e956 commit 4b43091

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

gui/src/actionCreators/actionCreators.spec.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ describe('Test fetchWithTimeout method', () => {
138138
});
139139

140140
it('dispatches RECIEVE_ERROR when no response is received', async () => {
141-
142141
const expectedActions = [
143142
actions.RECEIVE_ERROR,
144143
];
@@ -154,15 +153,13 @@ describe('Test fetchWithTimeout method', () => {
154153

155154

156155
it('should send a delayed response after timeout expires, thereby triggering abort() method of AbortController', async () => {
157-
158156
const timeout = 10
159-
const delay = (response, after = 500) => () => new Promise(resolve => setTimeout(resolve, after)).then(() => response);
160157

161158
// Send a delayed response, well after the timeout for the request has expired.
162159
// This should trigger the abort() method of the AbortController()
163-
fetchMock.mock('/get_status', delay(200, timeout + 100));
160+
fetchMock.getOnce('/get_status', new Promise(resolve => setTimeout(() => resolve({ body: 'ok' }), 1000 + timeout)));
164161

165-
const abortSpy = jest.spyOn(AbortController.prototype, 'abort');
162+
const abortSpy = jest.spyOn(global.AbortController.prototype, 'abort');
166163
const expectedActions = [
167164
actions.RECEIVE_ERROR,
168165
];

gui/src/actionCreators/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2023 The MathWorks, Inc.
1+
// Copyright 2020-2023 The MathWorks, Inc.
22

33
import {
44
SET_TRIGGER_POSITION,
@@ -362,4 +362,4 @@ export function fetchStartMatlab() {
362362
dispatch(receiveStartMatlab(data));
363363

364364
}
365-
}
365+
}

matlab_proxy/util/mwi/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2022 The MathWorks, Inc.
1+
# Copyright 2020-2023 The MathWorks, Inc.
22
"""Functions to access & control the logging behavior of the app
33
"""
44

0 commit comments

Comments
 (0)