@@ -162,27 +162,31 @@ it.layer(NodeServices.layer)("ensurePinnedRuntimeInstalled", (it) => {
162162 const path = yield * Path . Path ;
163163 const baseDir = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-pinned-archive-missing-" } ) ;
164164 const checksums = yield * validChecksums ;
165- const error = yield * ensurePinnedRuntimeInstalled ( {
166- baseDir,
167- version,
168- fs,
169- path,
170- platform : "linux" ,
171- arch : "x64" ,
172- httpClient : HttpClient . make ( ( request ) =>
173- Effect . succeed (
174- HttpClientResponse . fromWeb (
175- request ,
176- request . url . endsWith ( "/SHA256SUMS" )
177- ? new Response ( checksums )
178- : new Response ( "" , { status : 404 } ) ,
165+ const failsWith = ( status : number ) =>
166+ ensurePinnedRuntimeInstalled ( {
167+ baseDir,
168+ version,
169+ fs,
170+ path,
171+ platform : "linux" ,
172+ arch : "x64" ,
173+ httpClient : HttpClient . make ( ( request ) =>
174+ Effect . succeed (
175+ HttpClientResponse . fromWeb (
176+ request ,
177+ request . url . endsWith ( "/SHA256SUMS" )
178+ ? new Response ( checksums )
179+ : new Response ( "" , { status } ) ,
180+ ) ,
179181 ) ,
180182 ) ,
181- ) ,
182- runner : extractingRunner ( fs , path ) ,
183- validate : ( ) => Effect . die ( "must not validate a missing archive" ) ,
184- } ) . pipe ( Effect . flip ) ;
185- assert . isTrue ( isUnpublishedRelease ( error ) ) ;
183+ // "404" in the mirror's path must not read a server error as a missing release.
184+ releaseBaseUrl : "https://updates.example.com/404/t3code" ,
185+ runner : extractingRunner ( fs , path ) ,
186+ validate : ( ) => Effect . die ( "must not validate a missing archive" ) ,
187+ } ) . pipe ( Effect . flip ) ;
188+ assert . isTrue ( isUnpublishedRelease ( yield * failsWith ( 404 ) ) ) ;
189+ assert . isFalse ( isUnpublishedRelease ( yield * failsWith ( 500 ) ) ) ;
186190 } ) ,
187191 ) ;
188192
0 commit comments