Browse Source

Merge pull request #15216 from smatvienko-tb/fix/lwm2m-fw-update-flaky-test

Fix flaky Ota5LwM2MIntegrationTest.testFirmwareUpdateByObject5_Ok
pull/15226/head
Viacheslav Klimov 7 months ago
committed by GitHub
parent
commit
e0c22e55ae
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      application/src/test/java/org/thingsboard/server/transport/lwm2m/client/FwLwM2MDevice.java

9
application/src/test/java/org/thingsboard/server/transport/lwm2m/client/FwLwM2MDevice.java

@ -171,7 +171,14 @@ public class FwLwM2MDevice extends BaseInstanceEnabler implements Destroyable {
if (this.leshanClient != null) {
log.info("Stop/reboot LwM2M client {}", this.leshanClient.getEndpoint(identity));
this.leshanClient.stop(false);
try {
this.leshanClient.stop(false);
} catch (Exception stopEx) {
// Leshan may throw NPE during CoAP observe-relation cleanup when the server
// reference is null (race condition in NotificationDataStore.toKey()).
// The client is still considered stopped at this point — proceed with restart.
log.warn("Exception during LwM2M client stop, proceeding with restart: {}", stopEx.getMessage());
}
log.info("Start after update fw LwM2M client {}", this.leshanClient.getEndpoint(identity));
this.leshanClient.start();

Loading…
Cancel
Save