Skip to content

Commit 4f4804a

Browse files
committed
Tweak how tests ignore lock perf warnings
1 parent 45c98cc commit 4f4804a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/test_common.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ static void DebugOutput( ESteamNetworkingSocketsDebugOutputType eType, const cha
4949
fflush( g_fpLog );
5050

5151
// !KLUDGE! Our logging (which is done while we hold the lock)
52-
// is occasionally triggering this assert. Just ignroe that one
52+
// is occasionally triggering this assert. Just ignore that one
5353
// error for now.
5454
// Yes, this is a kludge.
55-
if ( strstr( pszMsg, "SteamNetworkingGlobalLock held for" ) )
55+
if ( strstr( pszMsg, "lock held for" ) || strstr( pszMsg, "waited" ) && strstr( pszMsg, "for lock" ) )
5656
return;
5757

5858
fprintf( stderr, "\n\n"
@@ -113,7 +113,11 @@ void TEST_Init( const SteamNetworkingIdentity *pIdentity )
113113

114114
// Test machines are not always realtime systems and may experience thread starvation.
115115
// Set very high lock performance warnings so they don't cause test failures.
116-
SteamNetworkingSockets_SetLockWaitWarningThreshold( 500*1000 );
116+
#if __THREAD_SANITIZER__
117+
SteamNetworkingSockets_SetLockWaitWarningThreshold( 2000*1000);
118+
#else
119+
SteamNetworkingSockets_SetLockWaitWarningThreshold( 300*1000 );
120+
#endif
117121

118122
#ifdef STEAMNETWORKINGSOCKETS_OPENSOURCE
119123
SteamDatagramErrMsg errMsg;

0 commit comments

Comments
 (0)