Skip to content

Commit

Permalink
tests: net: lwm2m: Remove timing sensitive assert
Browse files Browse the repository at this point in the history
As the lwm2m_reset_message() is stubbed, it does not remove
a message from rettry queue. Therefore depending on the
simulation speed, retries can happen one or many times.

Signed-off-by: Seppo Takalo <[email protected]>
  • Loading branch information
SeppoTakalo authored and nashif committed Jun 26, 2023
1 parent 0f6ded7 commit e92f8ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/net/lib/lwm2m/lwm2m_engine/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static int lwm2m_get_bool_custom_fake(const struct lwm2m_obj_path *path, bool *v

static void test_service(struct k_work *work)
{
LOG_INF("Test service");
k_sleep(K_MSEC(10));
}

Expand Down Expand Up @@ -339,8 +338,8 @@ ZTEST(lwm2m_engine, test_retransmit_request)
k_sleep(K_MSEC(500));
ret = lwm2m_engine_stop(&ctx);
zassert_equal(ret, 0);
zassert_equal(lwm2m_reset_message_fake.call_count, 1, "Message was not reseted");
zassert_equal(lwm2m_send_message_async_fake.call_count, 1, "Message was not sent");
zassert_not_equal(lwm2m_reset_message_fake.call_count, 0, "Message was not reseted");
zassert_not_equal(lwm2m_send_message_async_fake.call_count, 0, "Message was not sent");
}

ZTEST(lwm2m_engine, test_socket_recv)
Expand Down

0 comments on commit e92f8ac

Please sign in to comment.