Skip to content

Commit 96d7b97

Browse files
ihsanlatheefmluukkai
authored andcommitted
Update part4b.md
This update is proposed to fix the issue with Mongoose timeout that occurs despite introducing a delay of 100000ms in the callback function.
1 parent a7360a2 commit 96d7b97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/content/4/en/part4b.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ test('notes are returned as json', async () => {
214214

215215
This third parameter sets the timeout to 100000 ms. A long timeout ensures that our test won't fail due to the time it takes to run. (A long timeout may not be what you want for tests based on performance or speed, but this is fine for our example tests).
216216

217+
If you still encounter issues with mongoose timeouts, set `bufferTimeoutMS` variable to a value significantly higher than 10000 (10 seconds). You could set it like this at the top, right after the `require` statements. `mongoose.set("bufferTimeoutMS", 30000)`
218+
217219
One tiny but important detail: at the [beginning](/en/part4/structure_of_backend_application_introduction_to_testing#project-structure) of this part we extracted the Express application into the <i>app.js</i> file, and the role of the <i>index.js</i> file was changed to launch the application at the specified port via `app.listen`:
218220

219221
```js

0 commit comments

Comments
 (0)