Decrease the waiting time in the advanced friends test
authorChocobozzz <florian.bigard@gmail.com>
Mon, 7 Dec 2015 16:19:13 +0000 (17:19 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 7 Dec 2015 16:22:36 +0000 (17:22 +0100)
test/api/friendsAdvanced.js

index 5d3891923d1f99056648d6e9522138946bb87dff..1103d3a970b84f45ea5ab4c37a60d3ec874edb71 100644 (file)
 
             // Expulse pod 4 from pod 1 and 2
             uploadVideo(1, function () {
-              setTimeout(function () {
-                uploadVideo(1, function () {
-                  setTimeout(function () {
+              uploadVideo(2, function () {
+                setTimeout(function () {
+                  uploadVideo(1, function () {
                     uploadVideo(2, function () {
                       setTimeout(function () {
-                        uploadVideo(2, function () {
-                          setTimeout(function () {
-                            // Rerun server 4
-                            utils.runServer(4, function (app, url) {
-                              apps[3] = app
-                              getFriendsList(4, function (err, res) {
+                        // Rerun server 4
+                        utils.runServer(4, function (app, url) {
+                          apps[3] = app
+                          getFriendsList(4, function (err, res) {
+                            if (err) throw err
+                            // Pod 4 didn't know pod 1 and 2 removed it
+                            expect(res.body.length).to.equal(3)
+
+                            // Pod 6 ask pod 1, 2 and 3
+                            makeFriend(6, function () {
+                              getFriendsList(6, function (err, res) {
                                 if (err) throw err
-                                // Pod 4 didn't know pod 1 and 2 removed it
-                                expect(res.body.length).to.equal(3)
-
-                                // Pod 6 ask pod 1, 2 and 3
-                                makeFriend(6, function () {
-                                  getFriendsList(6, function (err, res) {
-                                    if (err) throw err
-
-                                    // Pod 4 should not be our friend
-                                    var result = res.body
-                                    expect(result.length).to.equal(3)
-                                    for (var pod of result) {
-                                      expect(pod.url).not.equal(urls[3])
-                                    }
-
-                                    done()
-                                  })
-                                })
+
+                                // Pod 4 should not be our friend
+                                var result = res.body
+                                expect(result.length).to.equal(3)
+                                for (var pod of result) {
+                                  expect(pod.url).not.equal(urls[3])
+                                }
+
+                                done()
                               })
                             })
-                          }, 15000)
+                          })
                         })
                       }, 15000)
                     })
-                  }, 15000)
-                })
-              }, 15000)
+                  })
+                }, 11000)
+              })
             })
           })
         })