2014-02-12 12:27:43 -05:00
|
|
|
Client = require "./helpers/Client"
|
|
|
|
request = require "request"
|
|
|
|
require("chai").should()
|
2018-02-16 06:36:32 -05:00
|
|
|
ClsiApp = require "./helpers/ClsiApp"
|
|
|
|
|
2014-02-12 12:27:43 -05:00
|
|
|
|
|
|
|
describe "Timed out compile", ->
|
|
|
|
before (done) ->
|
|
|
|
@request =
|
|
|
|
options:
|
2017-01-24 06:07:54 -05:00
|
|
|
timeout: 1 #seconds
|
2014-02-12 12:27:43 -05:00
|
|
|
resources: [
|
|
|
|
path: "main.tex"
|
|
|
|
content: '''
|
|
|
|
\\documentclass{article}
|
|
|
|
\\begin{document}
|
|
|
|
Hello world
|
2017-01-24 06:07:54 -05:00
|
|
|
\\input{|"sleep 10"}
|
2014-02-12 12:27:43 -05:00
|
|
|
\\end{document}
|
|
|
|
'''
|
|
|
|
]
|
|
|
|
@project_id = Client.randomId()
|
2018-02-16 06:36:32 -05:00
|
|
|
ClsiApp.ensureRunning =>
|
|
|
|
Client.compile @project_id, @request, (@error, @res, @body) => done()
|
2014-02-12 12:27:43 -05:00
|
|
|
|
|
|
|
it "should return a timeout error", ->
|
|
|
|
@body.compile.error.should.equal "container timed out"
|
|
|
|
|
2014-05-19 07:18:57 -04:00
|
|
|
it "should return a timedout status", ->
|
|
|
|
@body.compile.status.should.equal "timedout"
|
2014-02-12 12:27:43 -05:00
|
|
|
|