@@ -52,7 +52,7 @@ const SPONSOR_TIER = 'sponsors';
52
52
const BACKER_TIER = 'backers' ;
53
53
54
54
// if this percent of fetches completes, the build will pass
55
- const PRODUCTION_SUCCESS_THRESHOLD = 0.8 ;
55
+ const PRODUCTION_SUCCESS_THRESHOLD = 0.9 ;
56
56
57
57
const SUPPORTER_IMAGE_PATH = resolve ( __dirname , '../images/supporters' ) ;
58
58
@@ -107,7 +107,7 @@ const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD
107
107
try {
108
108
const { avatar : url } = supporter ;
109
109
const { body : imageBuf , headers} = await needle ( 'get' , url , {
110
- timeout : 2000
110
+ open_timeout : 30000
111
111
} ) ;
112
112
if ( headers [ 'content-type' ] . startsWith ( 'text/html' ) ) {
113
113
throw new TypeError (
@@ -247,16 +247,16 @@ const getSupporters = async () => {
247
247
248
248
const backerCount = supporters [ BACKER_TIER ] . length ;
249
249
const sponsorCount = supporters [ SPONSOR_TIER ] . length ;
250
- const totalValidSupportersCount = backerCount + sponsorCount ;
251
- const successRate = totalValidSupportersCount / invalidSupporters . length ;
250
+ const totalSupportersCount = backerCount + sponsorCount ;
251
+ const successRate = 1 - invalidSupporters . length / totalSupportersCount ;
252
252
253
253
debug (
254
254
'found %d valid backers and %d valid sponsors (%d total; %d invalid; %d blocked)' ,
255
255
backerCount ,
256
256
sponsorCount ,
257
- totalValidSupportersCount ,
257
+ totalSupportersCount ,
258
258
invalidSupporters . length ,
259
- uniqueSupporters . size - totalValidSupportersCount
259
+ uniqueSupporters . size - totalSupportersCount
260
260
) ;
261
261
262
262
if ( successRate < PRODUCTION_SUCCESS_THRESHOLD ) {
0 commit comments