Skip to content

Commit

Permalink
Remove random jitter to appease MacOS in CI
Browse files Browse the repository at this point in the history
This commit was made because the MacOS CI jobs [seem to have taken
issue][1] with how we were doing things previously.

[1]: https://github.com/aws/aws-lc/actions/runs/8014000000/job/21891957419?pr=1449
  • Loading branch information
WillChilds-Klein committed Feb 23, 2024
1 parent ff09fac commit bfd778c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crypto/x509/x509_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <openssl/nid.h>
#include <openssl/pem.h>
#include <openssl/pool.h>
#include <openssl/rand.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

Expand Down Expand Up @@ -5051,12 +5050,9 @@ TEST(X509Test, AddDuplicates) {
threads.emplace_back([&] {
// Firstly, save off |i| in the thread's context.
const size_t idx = i;
// Sleep with some jitter to offset thread execution
uint8_t sleep_buf[1];
ASSERT_TRUE(RAND_bytes(sleep_buf, sizeof(sleep_buf)));
std::this_thread::sleep_for(std::chrono::milliseconds(sleep_buf[0] % 100));
// Half the threads add duplicate certs, the other half take a lock and
// look them up to exercise un/locking functions.
// look them up to exercise un/locking functions. No sleep, let them
// contend as quickly as possible.
if (idx % 2 == 0) {
EXPECT_TRUE(X509_STORE_add_cert(store.get(), a.get()));
EXPECT_TRUE(X509_STORE_add_cert(store.get(), b.get()));
Expand Down

0 comments on commit bfd778c

Please sign in to comment.