Skip to content

Commit

Permalink
feat: Move spin lock
Browse files Browse the repository at this point in the history
  • Loading branch information
devanbenz committed Jan 7, 2025
1 parent 988d1e3 commit 5b7896a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions query/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,6 @@ func TestQueryExecutor_ChangeEvent(t *testing.T) {
Op: fsnotify.Rename,
}

for time.Now().Before(deadline) {
if mockWatcher.ChangeEvents.Load() == 1 {
break
}

runtime.Gosched()
}

q, err = influxql.ParseQuery(`SELECT count(value) FROM mem`)

e.StatementExecutor = &StatementExecutor{
Expand All @@ -835,6 +827,14 @@ func TestQueryExecutor_ChangeEvent(t *testing.T) {

discardOutput(e.ExecuteQuery(q, query.ExecutionOptions{}, nil))

for time.Now().Before(deadline) {
if mockWatcher.ChangeEvents.Load() == 1 {
break
}

runtime.Gosched()
}

require.True(t, mockWatcher.Contains(`SELECT count(value) FROM mem`))

require.Equal(t, uint64(1), mockWatcher.ChangeEvents.Load())
Expand Down

0 comments on commit 5b7896a

Please sign in to comment.