forked from forgejo/forgejo
Reduce data races (#14549)
* Add race conditions into test * Fix Race in GetManager() * DataAsync() use error chan * just log no chan * finish
This commit is contained in:
parent
0d1444751f
commit
87009ab40a
3 changed files with 18 additions and 6 deletions
|
@ -12,6 +12,15 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetManager(t *testing.T) {
|
||||
go func() {
|
||||
// test race protection
|
||||
_ = GetManager()
|
||||
}()
|
||||
pm := GetManager()
|
||||
assert.NotNil(t, pm)
|
||||
}
|
||||
|
||||
func TestManager_Add(t *testing.T) {
|
||||
pm := Manager{processes: make(map[int64]*Process)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue