-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GODT-1615): Fix too many SQL variables error
Perform paged loading of snapshot state from the database to avoid SQL error. This patch also adds an utility to to fill the database with many messages and invoke `Flush()` after they have all been submitted. Testing large mailboxes can cause the CI to timeout, specially on windows (>10 min), therefore the test is added as a benchmark instead.
- Loading branch information
1 parent
68d9cc3
commit bc89d58
Showing
3 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tests | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
) | ||
|
||
func BenchmarkBigMailboxStatus(b *testing.B) { | ||
b.Run("status", func(b *testing.B) { | ||
runOneToOneTestWithAuth(b, defaultServerOptions(b), func(c *testConnection, s *testSession) { | ||
mboxID := s.mailboxCreated("user", []string{"mbox"}) | ||
|
||
ids := s.batchMessageCreated("user", mboxID, 32515, func(n int) ([]byte, []string) { | ||
return []byte(fmt.Sprintf(`To: %[email protected]`, n)), []string{} | ||
}) | ||
|
||
c.Cf(`A001 STATUS %v (MESSAGES)`, "mbox").Sx(fmt.Sprintf(`MESSAGES %v`, len(ids))).OK(`A001`) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters