mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 13:09:23 -05:00
[TESTS] Speed up TestEventSourceManagerRun
- `setting.UI.Notification.EventSourceUpdateTime` is by default 10
seconds, which adds an 10 second delay before the test succeeds.
- Lower the interval to reduce it to at most 3 second delay (the code
only send events when they are at least 2 seconds old 🤷).
This commit is contained in:
parent
58eda04aa7
commit
c0b4a064e9
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
packages_model "code.gitea.io/gitea/models/packages"
|
packages_model "code.gitea.io/gitea/models/packages"
|
||||||
|
@ -43,6 +44,9 @@ func InitTest(requireGitea bool) {
|
||||||
exitf("Environment variable $GITEA_ROOT not set")
|
exitf("Environment variable $GITEA_ROOT not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Speedup tests that rely on the event source ticker.
|
||||||
|
setting.UI.Notification.EventSourceUpdateTime = time.Second
|
||||||
|
|
||||||
setting.IsInTesting = true
|
setting.IsInTesting = true
|
||||||
setting.AppWorkPath = giteaRoot
|
setting.AppWorkPath = giteaRoot
|
||||||
setting.CustomPath = filepath.Join(setting.AppWorkPath, "custom")
|
setting.CustomPath = filepath.Join(setting.AppWorkPath, "custom")
|
||||||
|
|
Loading…
Reference in a new issue