Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix concurrency issue in GatewayTest.groovy

Rich Turner63ec97a670ff
diff --git a/test/src/test/groovy/org/openremote/test/gateway/GatewayTest.groovy b/test/src/test/groovy/org/openremote/test/gateway/GatewayTest.groovy
index 7fbcb4823..d0c8dbfb1 100644
--- a/test/src/test/groovy/org/openremote/test/gateway/GatewayTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/gateway/GatewayTest.groovy
@@ -479,6 +479,7 @@ class GatewayTest extends Specification implements ManagerContainerTrait {
}
}, 100, 100))
building1Room5Asset = assetStorageService.merge(building1Room5Asset)
+ building1Room5Asset = assetStorageService.find(building1Room5AssetId) // Re-fetch asset as modifying instance returned by merge will cause concurrency issues
then: "the asset should have been added to the gateway and eventually replicated in the local manager"
assert building1Room5Asset != null
@@ -500,6 +501,7 @@ class GatewayTest extends Specification implements ManagerContainerTrait {
}
}, 100, 100))
building1Room5Asset = assetStorageService.merge(building1Room5Asset)
+ building1Room5Asset = assetStorageService.find(building1Room5AssetId) // Re-fetch asset as modifying instance returned by merge will cause concurrency issues
then: "the asset should also be updated in the local manager"
assert building1Room5Asset != null