Skip to content

Commit f649cff

Browse files
committed
fix: add additional delay in unit test to improve successful test runs
Signed-off-by: James Chapman <james.chapman@pionix.de>
1 parent e918cb7 commit f649cff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/EVSE/Auth/tests/auth_tests.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// Copyright Pionix GmbH and Contributors to EVerest
33

4+
#include <chrono>
45
#include <gmock/gmock.h>
56
#include <gtest/gtest.h>
67
#include <iostream>
@@ -1630,7 +1631,9 @@ TEST_F(AuthTest, test_plug_in_time_out) {
16301631
std::vector<int32_t> connectors{1};
16311632
ProvidedIdToken provided_token = get_provided_token(VALID_TOKEN_1, connectors);
16321633

1633-
std::this_thread::sleep_for(std::chrono::seconds(CONNECTION_TIMEOUT));
1634+
// ensure that the timeout has elapsed
1635+
const auto delay = std::chrono::milliseconds(250) + std::chrono::seconds(CONNECTION_TIMEOUT);
1636+
std::this_thread::sleep_for(delay);
16341637

16351638
EXPECT_CALL(mock_publish_token_validation_status_callback,
16361639
Call(Field(&ProvidedIdToken::id_token, provided_token.id_token), TokenValidationStatus::Processing));

0 commit comments

Comments
 (0)