Refactor stress test files for improved readability and functionality

- Simplified the reify stress test by consolidating the reifyInstance call into a single line for better clarity.
- Added a cleanup function in the stressPatterns test to manage knownIds, ensuring that IDs of destroyed instances are removed.
- Enhanced the logic for adding, removing, and updating instances in the stressPatterns test to verify the existence of parent and child instances before operations, improving test robustness.
- Reformatted code in LargeTreeGenerator and MockApiContext for consistency and readability.
This commit is contained in:
Joe 2026-02-01 22:10:18 -06:00
parent 01110fc916
commit d513ab16c0
4 changed files with 48 additions and 31 deletions

View file

@ -208,7 +208,8 @@ function LargeTreeGenerator.createVirtualTree(options)
if withDuplicates and currentDepth <= 1 then
for _ = 1, duplicateCount do
local duplicateName = prefix .. "_1" -- Same as first child
local duplicateId = createVirtualInstance(duplicateName, id, currentDepth + 1, duplicateName .. "_dup")
local duplicateId =
createVirtualInstance(duplicateName, id, currentDepth + 1, duplicateName .. "_dup")
table.insert(children, duplicateId)
end
end

View file

@ -108,13 +108,14 @@ function MockApiContext:connect()
end
-- Default connect response
return true, {
serverVersion = "0.0.0-mock",
protocolVersion = 4,
sessionId = HttpService:GenerateGUID(false),
expectedPlaceIds = {},
rootInstanceId = HttpService:GenerateGUID(false),
}
return true,
{
serverVersion = "0.0.0-mock",
protocolVersion = 4,
sessionId = HttpService:GenerateGUID(false),
expectedPlaceIds = {},
rootInstanceId = HttpService:GenerateGUID(false),
}
end
--[[