Commit Graph
2 Commits
Author SHA1 Message Date
zhangwenjian 3afe083499 test✅: restore the tenant's previous database after the opera log test
sdk.Runtime is process-wide, so setting the tenant back to nil on cleanup
could overwrite a mapping another test had installed. Save the previous
value and put it back, as common/middleware/db_test.go does.
2026-10-01 22:09:55 +08:00
zhangwenjian 8af88968b1 test✅: cover the operation log's truncation on a character boundary
SaveOperaLog shortens JsonResult to 100 characters before writing it.
#944 changed that from a byte cut to a rune cut, but no test referenced
it, so putting the byte cut back would turn nothing red.

The test drives the real SaveOperaLog with 150 three-byte characters and
reads the row back: the stored value must be valid UTF-8 and keep exactly
100 characters. With the byte cut restored it fails with an invalid
trailing byte and 34 characters kept.
2026-10-01 21:00:44 +08:00