Skip to content

Commit 9f0fbf1

Browse files
author
Rye
committed
Reenable and fix llcorehttp, llkdu, and llurlentry tests on non-windows
1 parent 0aa1392 commit 9f0fbf1

File tree

7 files changed

+18
-137
lines changed

7 files changed

+18
-137
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ jobs:
138138
libxcursor-dev libxfixes-dev libgstreamer1.0-dev \
139139
libgstreamer-plugins-base1.0-dev ninja-build libxft-dev \
140140
llvm mold libpipewire-0.3-dev libdbus-1-dev
141+
sudo locale-gen en_US.UTF-8
142+
sudo locale-gen en_GB.UTF-8
143+
sudo locale-gen fr_FR.UTF-8
141144
142145
- name: Install windows dependencies
143146
if: runner.os == 'Windows'

indra/llcorehttp/examples/http_texture_load.cpp

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252

5353
void init_curl();
5454
void term_curl();
55-
void ssl_thread_id_callback(CRYPTO_THREADID*);
56-
void ssl_locking_callback(int mode, int type, const char * file, int line);
5755
void usage(std::ostream & out);
5856

5957
// Default command line settings
@@ -606,63 +604,15 @@ void WorkingSet::loadAssetUuids(FILE * in)
606604
}
607605

608606

609-
int ssl_mutex_count(0);
610-
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
611-
612607
void init_curl()
613608
{
614609
curl_global_init(CURL_GLOBAL_ALL);
615-
616-
ssl_mutex_count = CRYPTO_num_locks();
617-
if (ssl_mutex_count > 0)
618-
{
619-
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
620-
621-
for (int i(0); i < ssl_mutex_count; ++i)
622-
{
623-
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
624-
}
625-
626-
CRYPTO_set_locking_callback(ssl_locking_callback);
627-
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
628-
}
629610
}
630611

631612

632613
void term_curl()
633614
{
634-
CRYPTO_set_locking_callback(NULL);
635-
for (int i(0); i < ssl_mutex_count; ++i)
636-
{
637-
delete ssl_mutex_list[i];
638-
}
639-
delete [] ssl_mutex_list;
640-
}
641-
642-
643-
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
644-
{
645-
#if defined(WIN32)
646-
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
647-
#else
648-
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
649-
#endif
650-
}
651-
652-
653-
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
654-
{
655-
if (type >= 0 && type < ssl_mutex_count)
656-
{
657-
if (mode & CRYPTO_LOCK)
658-
{
659-
ssl_mutex_list[type]->lock();
660-
}
661-
else
662-
{
663-
ssl_mutex_list[type]->unlock();
664-
}
665-
}
615+
curl_global_cleanup();
666616
}
667617

668618

indra/llcorehttp/tests/llcorehttp_test.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@
4141
#include "test_httpstatus.hpp"
4242
#include "test_refcounted.hpp"
4343
#include "test_httpoperation.hpp"
44-
// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release
45-
// builds for reasons not yet diagnosed.
46-
// On Linux too, this is likely to badly handling (p)thread creation and not waiting
47-
// for threads to properly shutdown
48-
#if LL_WINDOWS
4944
#include "test_httprequest.hpp"
50-
#endif
5145

5246
#include "test_httpheaders.hpp"
5347
#include "test_httprequestqueue.hpp"
@@ -56,9 +50,6 @@
5650
#include "llproxy.h"
5751
#include "llcleanup.h"
5852

59-
void ssl_thread_id_callback(CRYPTO_THREADID*);
60-
void ssl_locking_callback(int mode, int type, const char * file, int line);
61-
6253
#if 0 // lltut provides main and runner
6354

6455
namespace tut
@@ -83,67 +74,17 @@ int main()
8374

8475
#endif // 0
8576

86-
int ssl_mutex_count(0);
87-
LLCoreInt::HttpMutex ** ssl_mutex_list = NULL;
88-
8977
void init_curl()
9078
{
9179
curl_global_init(CURL_GLOBAL_ALL);
9280

93-
ssl_mutex_count = CRYPTO_num_locks();
94-
if (ssl_mutex_count > 0)
95-
{
96-
ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count];
97-
98-
for (int i(0); i < ssl_mutex_count; ++i)
99-
{
100-
ssl_mutex_list[i] = new LLCoreInt::HttpMutex;
101-
}
102-
103-
CRYPTO_set_locking_callback(ssl_locking_callback);
104-
CRYPTO_THREADID_set_callback(ssl_thread_id_callback);
105-
}
106-
10781
LLProxy::getInstance();
10882
}
10983

11084

11185
void term_curl()
11286
{
11387
SUBSYSTEM_CLEANUP(LLProxy);
114-
115-
CRYPTO_set_locking_callback(NULL);
116-
for (int i(0); i < ssl_mutex_count; ++i)
117-
{
118-
delete ssl_mutex_list[i];
119-
}
120-
delete [] ssl_mutex_list;
121-
}
122-
123-
124-
void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid)
125-
{
126-
#if defined(WIN32)
127-
CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread());
128-
#else
129-
CRYPTO_THREADID_set_pointer(pthreadid, pthread_self());
130-
#endif
131-
}
132-
133-
134-
void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */)
135-
{
136-
if (type >= 0 && type < ssl_mutex_count)
137-
{
138-
if (mode & CRYPTO_LOCK)
139-
{
140-
ssl_mutex_list[type]->lock();
141-
}
142-
else
143-
{
144-
ssl_mutex_list[type]->unlock();
145-
}
146-
}
14788
}
14889

14990

indra/llcorehttp/tests/test_httprequest.hpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,10 @@ void HttpRequestTestObjectType::test<4>()
454454
template <> template <>
455455
void HttpRequestTestObjectType::test<5>()
456456
{
457+
#ifndef LL_WINDOWS
458+
skip("Skip due to issues with testing thread cancellation");
459+
#endif
460+
457461
ScopedCurlInit ready;
458462

459463
set_test_name("HttpRequest Spin (soft) + NoOp + hard termination");
@@ -517,6 +521,9 @@ void HttpRequestTestObjectType::test<5>()
517521
template <> template <>
518522
void HttpRequestTestObjectType::test<6>()
519523
{
524+
#ifndef LL_WINDOWS
525+
skip("Skip due to issues with testing thread cancellation");
526+
#endif
520527
ScopedCurlInit ready;
521528

522529
set_test_name("HttpRequest Spin + NoOp + hard termination");
@@ -2737,13 +2744,6 @@ void HttpRequestTestObjectType::test<22>()
27372744

27382745
set_test_name("BUG-2295");
27392746

2740-
#if LL_WINDOWS && ADDRESS_SIZE == 64
2741-
// teamcity win64 builds freeze on this test, if you figure out the cause, please fix it
2742-
if (getenv("TEAMCITY_PROJECT_NAME"))
2743-
{
2744-
skip("BUG-2295 - partial load on W64 causes freeze");
2745-
}
2746-
#endif
27472747
// Handler can be stack-allocated *if* there are no dangling
27482748
// references to it after completion of this method.
27492749
// Create before memory record as the string copy will bump numbers.
@@ -2779,7 +2779,7 @@ void HttpRequestTestObjectType::test<22>()
27792779
for (int i(0); i < test_count; ++i)
27802780
{
27812781
char buffer[128];
2782-
sprintf(buffer, "/bug2295/%d/", i);
2782+
snprintf(buffer, sizeof(buffer), "/bug2295/%d/", i);
27832783
HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,
27842784
url_base + buffer,
27852785
0,
@@ -2810,7 +2810,7 @@ void HttpRequestTestObjectType::test<22>()
28102810
for (int i(0); i < test2_count; ++i)
28112811
{
28122812
char buffer[128];
2813-
sprintf(buffer, "/bug2295/00000012/%d/", i);
2813+
snprintf(buffer, sizeof(buffer), "/bug2295/00000012/%d/", i);
28142814
HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,
28152815
url_base + buffer,
28162816
0,
@@ -2841,7 +2841,7 @@ void HttpRequestTestObjectType::test<22>()
28412841
for (int i(0); i < test3_count; ++i)
28422842
{
28432843
char buffer[128];
2844-
sprintf(buffer, "/bug2295/inv_cont_range/%d/", i);
2844+
snprintf(buffer, sizeof(buffer), "/bug2295/inv_cont_range/%d/", i);
28452845
HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,
28462846
url_base + buffer,
28472847
0,
@@ -2917,14 +2917,6 @@ void HttpRequestTestObjectType::test<23>()
29172917

29182918
set_test_name("HttpRequest GET 503s with 'Retry-After'");
29192919

2920-
#if LL_WINDOWS && ADDRESS_SIZE == 64
2921-
// teamcity win64 builds freeze on this test, if you figure out the cause, please fix it
2922-
if (getenv("TEAMCITY_PROJECT_NAME"))
2923-
{
2924-
skip("llcorehttp 503-with-retry test hangs on Windows 64");
2925-
}
2926-
#endif
2927-
29282920
// This tests mainly that the code doesn't fall over if
29292921
// various well- and mis-formed Retry-After headers are
29302922
// sent along with the response. Direct inspection of

indra/llcorehttp/tests/test_llcorehttp_peer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
"""\
3-
@file test_llsdmessage_peer.py
3+
@file test_llcorehttp_peer.py
44
@author Nat Goodspeed
55
@date 2008-10-09
66
@brief This script asynchronously runs the executable (with args) specified on

indra/llcorehttp/tests/test_refcounted.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
#include "_refcounted.h"
3030

31-
// disable all of this because it's hanging win64 builds?
32-
#if ! (LL_WINDOWS && ADDRESS_SIZE == 64)
3331
using namespace LLCoreInt;
3432

3533
namespace tut
@@ -122,5 +120,4 @@ namespace tut
122120
ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED);
123121
}
124122
}
125-
#endif // disabling on Win64
126123
#endif // TEST_LLCOREINT_REF_COUNTED_H_

indra/llui/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@ if(LL_TESTS)
283283
)
284284
set_property( SOURCE ${llui_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES ${test_libs})
285285
LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
286-
# INTEGRATION TESTS
287286

288-
if(NOT LINUX)
289-
set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ll::SDL2)
290-
LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}")
291-
endif(NOT LINUX)
287+
# INTEGRATION TESTS
288+
set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ll::SDL2)
289+
LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}")
292290
endif(LL_TESTS)

0 commit comments

Comments
 (0)