Skip to content

Commit

Permalink
fix(test): Make check_client_subscriptions.c time-deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Oct 22, 2023
1 parent 42b4aa5 commit 4e142bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/client/check_client_subscriptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,11 @@ START_TEST(Client_subscription_keepAlive) {
UA_UInt32 monId = monResponse.monitoredItemId;

/* Ensure that the subscription is late */
running = false;
THREAD_JOIN(server_thread);
UA_fakeSleep((UA_UInt32)(publishingInterval + 1));
running = true;
THREAD_CREATE(server_thread, serverloop);

/* Manually send a publish request */
UA_PublishRequest pr;
Expand All @@ -769,7 +773,12 @@ START_TEST(Client_subscription_keepAlive) {
UA_PublishResponse_clear(&presponse);
UA_PublishRequest_clear(&pr);

/* Ensure that the subscription is late */
running = false;
THREAD_JOIN(server_thread);
UA_fakeSleep((UA_UInt32)(publishingInterval + 1));
running = true;
THREAD_CREATE(server_thread, serverloop);

UA_PublishRequest_init(&pr);
pr.subscriptionAcknowledgementsSize = 0;
Expand Down

0 comments on commit 4e142bb

Please sign in to comment.