Skip to content

Commit 513c002

Browse files
committed
fix data-race
1 parent fbf4350 commit 513c002

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/integration/pull_status_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ func TestPullCreate_EmptyChangesWithSameCommits(t *testing.T) {
172172

173173
func TestPullStatusDelayCheck(t *testing.T) {
174174
onGiteaRun(t, func(t *testing.T, u *url.URL) {
175-
defer test.MockVariableValue(&setting.IsProd)()
176175
defer test.MockVariableValue(&setting.Repository.PullRequest.DelayCheckForInactiveDays, 1)()
177176
defer test.MockVariableValue(&pull.AddPullRequestToCheckQueue)()
178177

@@ -203,11 +202,11 @@ func TestPullStatusDelayCheck(t *testing.T) {
203202
issue3, checkedPrID := run(t, func(t *testing.T) {})
204203
assert.Equal(t, issues.PullRequestStatusMergeable, issue3.PullRequest.Status)
205204
assert.Zero(t, checkedPrID)
206-
setting.IsProd = true
207205
assertReloadingInterval(t, "") // the PR is mergeable, so no need to reload the merge box
208-
setting.IsProd = false
209-
assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break
210-
setting.IsProd = true
206+
207+
// setting.IsProd = false // it would cause data-race because the queue handlers might be running and reading its value
208+
// assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break
209+
// setting.IsProd = true
211210

212211
// when base branch changes, PR status should be updated, but it is inactive for long time, so no real check
213212
issue3, checkedPrID = run(t, func(t *testing.T) {

0 commit comments

Comments
 (0)