Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7100c6b5
Commit
7100c6b5
authored
5 years ago
by
Winnie Hellmann
Committed by
Phil Hughes
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase Jest timeout on CI to 5 seconds
parent
70a717da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
spec/frontend/helpers/timeout.js
spec/frontend/helpers/timeout.js
+14
-2
spec/frontend/test_setup.js
spec/frontend/test_setup.js
+1
-1
No files found.
spec/frontend/helpers/timeout.js
View file @
7100c6b5
...
...
@@ -5,7 +5,13 @@ const IS_DEBUGGING = process.execArgv.join(' ').includes('--inspect-brk');
let
testTimeoutNS
;
export
const
setTestTimeout
=
newTimeoutMS
=>
{
testTimeoutNS
=
newTimeoutMS
*
NS_PER_MS
;
const
newTimeoutNS
=
newTimeoutMS
*
NS_PER_MS
;
// never accept a smaller timeout than the default
if
(
newTimeoutNS
<
testTimeoutNS
)
{
return
;
}
testTimeoutNS
=
newTimeoutNS
;
jest
.
setTimeout
(
newTimeoutMS
);
};
...
...
@@ -13,7 +19,13 @@ export const setTestTimeout = newTimeoutMS => {
// Useful for tests with jQuery, which is very slow in big DOMs.
let
temporaryTimeoutNS
=
null
;
export
const
setTestTimeoutOnce
=
newTimeoutMS
=>
{
temporaryTimeoutNS
=
newTimeoutMS
*
NS_PER_MS
;
const
newTimeoutNS
=
newTimeoutMS
*
NS_PER_MS
;
// never accept a smaller timeout than the default
if
(
newTimeoutNS
<
testTimeoutNS
)
{
return
;
}
temporaryTimeoutNS
=
newTimeoutNS
;
};
export
const
initializeTestTimeout
=
defaultTimeoutMS
=>
{
...
...
This diff is collapsed.
Click to expand it.
spec/frontend/test_setup.js
View file @
7100c6b5
...
...
@@ -15,7 +15,7 @@ afterEach(() =>
}),
);
initializeTestTimeout
(
500
);
initializeTestTimeout
(
process
.
env
.
CI
?
5000
:
500
);
// fail tests for unmocked requests
beforeEach
(
done
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment