maestro icon indicating copy to clipboard operation
maestro copied to clipboard

http.delete crash if no content (http 204) is return by an api

Open cmailfert opened this issue 1 month ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues and didn't find mine.

Steps to reproduce

  1. Create a flow who runScript
  2. In a script do an http.delete to an api who will return an 204 http status, with no contant in the response.

Actual results

org.graalvm.polyglot.PolyglotException
at okio.RealBufferedSource.require(RealBufferedSource.kt:203)
at okio.GzipSource.consumeHeader(GzipSource.kt:104)
at okio.GzipSource.read(GzipSource.kt:62)
at okio.RealBufferedSource.select(RealBufferedSource.kt:233)
at okhttp3.internal.Util.readBomAsCharset(Util.kt:265)
at okhttp3.ResponseBody.string(ResponseBody.kt:187)
at maestro.js.GraalJsHttp.executeRequest(GraalJsHttp.kt:97)
at maestro.js.GraalJsHttp.delete(GraalJsHttp.kt:48)
at deleteStop(../data/api/create_stop.js:17-21:354-515)
at :program(../data/api/create_stop.js:75:2039-2068)
at org.graalvm.polyglot.Context.eval(Context.java:402)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:86)
at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:26)
at maestro.orchestra.Orchestra.runScriptCommand(Orchestra.kt:536)
at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:360)
at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:255)
at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:173)
at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:196) at maestro.cli.runner.TestRunner$runSingle$result$1$1.invokeSuspend(TestRunner.kt:75) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at maestro.cli.runner.TestRunner.runSingle$lambda$0(TestRunner.kt:74) at maestro.cli.runner.TestRunner.runCatching-ta8aW1Q(TestRunner.kt:200)
at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:65)
at maestro.cli.command.TestCommand.runSingleFlow(TestCommand.kt:520)
at maestro.cli.command.TestCommand.runShardSuite$lambda$10(TestCommand.kt:489)
at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:129)
at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:65)
at maestro.cli.command.TestCommand.runShardSuite(TestCommand.kt:454)
at maestro.cli.command.TestCommand.access$runShardSuite(TestCommand.kt:80)
at maestro.cli.command.TestCommand$handleSessions$1$results$1$1.invokeSuspend(TestCommand.kt:413)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Caused by host exception: java.io.EOFException

Expected results

Should not throw an error

About app

  1. This is an flutter app on the last version of flutter

About environment

  • Run on mac book pro m3
  • java 23.0.1
  • Last version of mastro

Logs

Logs
org.graalvm.polyglot.PolyglotException                                      
        at okio.RealBufferedSource.require(RealBufferedSource.kt:203)       
        at okio.GzipSource.consumeHeader(GzipSource.kt:104)                 
        at okio.GzipSource.read(GzipSource.kt:62)                           
        at okio.RealBufferedSource.select(RealBufferedSource.kt:233)        
        at okhttp3.internal.Util.readBomAsCharset(Util.kt:265)              
        at okhttp3.ResponseBody.string(ResponseBody.kt:187)                 
        at maestro.js.GraalJsHttp.executeRequest(GraalJsHttp.kt:97)         
        at maestro.js.GraalJsHttp.delete(GraalJsHttp.kt:48)                 
        at <js> deleteStop(../data/api/create_stop.js:17-21:354-515)        
        at <js> :program(../data/api/create_stop.js:75:2039-2068)           
        at org.graalvm.polyglot.Context.eval(Context.java:402)              
        at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:86)     
        at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:26)     
        at maestro.orchestra.Orchestra.runScriptCommand(Orchestra.kt:536)   
        at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:360)     
        at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:255)    
        at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:173)            
        at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:196)
        at maestro.cli.runner.TestRunner$runSingle$result$1$1.invokeSuspend(TestRunner.kt:75)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)     
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)        
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at maestro.cli.runner.TestRunner.runSingle$lambda$0(TestRunner.kt:74)
        at maestro.cli.runner.TestRunner.runCatching-ta8aW1Q(TestRunner.kt:200)                                                                                                                                                          
        at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:65)                                                                                                                                                                     
        at maestro.cli.command.TestCommand.runSingleFlow(TestCommand.kt:520)                                                                                                                                                             
        at maestro.cli.command.TestCommand.runShardSuite$lambda$10(TestCommand.kt:489)                                                                                                                                                   
        at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:129)                                                                                                                                            
        at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:65)                                                                                                                                     
        at maestro.cli.command.TestCommand.runShardSuite(TestCommand.kt:454)                                                                                                                                                             
        at maestro.cli.command.TestCommand.access$runShardSuite(TestCommand.kt:80)                                                                                                                                                       
        at maestro.cli.command.TestCommand$handleSessions$1$results$1$1.invokeSuspend(TestCommand.kt:413)                                                                                                                                
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)                                                                                                                                        
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)                                                                                                                                                                  
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)                                                                                                                                            
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)                                                                                                                                                                       
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)                                                                                                                                         
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)                                                                                                                                
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)                                                                                                                                  
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)                                                                                                                                        
Caused by host exception: java.io.EOFException   

Maestro version

2.0.10

How did you install Maestro?

Homebrew

Anything else?

After discuss with the team on Slack:

https://github.com/mobile-dev-inc/Maestro/blob/96920b1f8ff64c705fb33b0abc004449909e65bb/maestro-client/src/main/java/maestro/js/GraalJsHttp.kt#L97 The string method in okhttp3's ResponseBody assumes some content to work on

cmailfert avatar Nov 20 '25 13:11 cmailfert

MAE-329

linear[bot] avatar Nov 20 '25 13:11 linear[bot]

I haven't been able to reproduce this using http.delete('https://httpbin.org/status/204') - we're working together in Slack to work out the differences

Fishbowler avatar Nov 20 '25 14:11 Fishbowler