Skip to content

Commit b50776d

Browse files
authored
refs #16338 make thttpclient_ssl_remotenetwork.nim less flaky (#17457)
1 parent 4f9aaee commit b50776d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/untestable/thttpclient_ssl_remotenetwork.nim

+14-3
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,23 @@ when enableRemoteNetworking and (defined(nimTestsEnableFlaky) or not defined(win
115115

116116
else:
117117
# this is unexpected
118+
var fatal = true
119+
var msg = ""
118120
if raised:
119-
echo " $# ($#) raised: $#" % [desc, $category, exception_msg]
121+
msg = " $# ($#) raised: $#" % [desc, $category, exception_msg]
122+
if "500 Internal Server Error" in exception_msg:
123+
# refs https://github.com/nim-lang/Nim/issues/16338#issuecomment-804300278
124+
# we got: `good (good) raised: 500 Internal Server Error`
125+
fatal = false
126+
msg.add " (http 500 => assuming this is not our problem)"
120127
else:
121-
echo " $# ($#) did not raise" % [desc, $category]
122-
if category in {good, dubious, bad}:
128+
msg = " $# ($#) did not raise" % [desc, $category]
129+
130+
if category in {good, dubious, bad} and fatal:
131+
echo "D20210322T121353: error: " & msg
123132
fail()
133+
else:
134+
echo "D20210322T121353: warning: " & msg
124135

125136

126137
suite "SSL certificate check - httpclient":

0 commit comments

Comments
 (0)