2020-02-19 06:16:07 -05:00
|
|
|
/* eslint-disable
|
|
|
|
no-unused-vars,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2020-02-19 06:16:00 -05:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2020-02-19 06:16:14 -05:00
|
|
|
const Client = require('./helpers/Client')
|
|
|
|
const request = require('request')
|
|
|
|
const ClsiApp = require('./helpers/ClsiApp')
|
2018-02-16 06:36:32 -05:00
|
|
|
|
2020-08-10 12:01:11 -04:00
|
|
|
describe('Timed out compile', function () {
|
|
|
|
before(function (done) {
|
2020-02-19 06:16:14 -05:00
|
|
|
this.request = {
|
|
|
|
options: {
|
2021-07-13 07:04:48 -04:00
|
|
|
timeout: 10,
|
2020-02-19 06:16:14 -05:00
|
|
|
}, // seconds
|
|
|
|
resources: [
|
|
|
|
{
|
|
|
|
path: 'main.tex',
|
|
|
|
content: `\
|
2020-02-19 06:16:00 -05:00
|
|
|
\\documentclass{article}
|
|
|
|
\\begin{document}
|
|
|
|
\\def\\x{Hello!\\par\\x}
|
|
|
|
\\x
|
|
|
|
\\end{document}\
|
2021-07-13 07:04:48 -04:00
|
|
|
`,
|
|
|
|
},
|
|
|
|
],
|
2020-02-19 06:16:14 -05:00
|
|
|
}
|
|
|
|
this.project_id = Client.randomId()
|
|
|
|
return ClsiApp.ensureRunning(() => {
|
|
|
|
return Client.compile(
|
|
|
|
this.project_id,
|
|
|
|
this.request,
|
|
|
|
(error, res, body) => {
|
|
|
|
this.error = error
|
|
|
|
this.res = res
|
|
|
|
this.body = body
|
|
|
|
return done()
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|
2014-02-12 12:27:43 -05:00
|
|
|
|
2020-08-10 12:01:11 -04:00
|
|
|
it('should return a timeout error', function () {
|
2020-02-19 06:16:14 -05:00
|
|
|
return this.body.compile.error.should.equal('container timed out')
|
|
|
|
})
|
2014-02-12 12:27:43 -05:00
|
|
|
|
2020-08-10 12:01:11 -04:00
|
|
|
it('should return a timedout status', function () {
|
2020-02-19 06:16:14 -05:00
|
|
|
return this.body.compile.status.should.equal('timedout')
|
|
|
|
})
|
2014-02-12 12:27:43 -05:00
|
|
|
|
2020-08-10 12:01:11 -04:00
|
|
|
return it('should return the log output file name', function () {
|
2021-07-13 07:04:48 -04:00
|
|
|
const outputFilePaths = this.body.compile.outputFiles.map(x => x.path)
|
2020-02-19 06:16:14 -05:00
|
|
|
return outputFilePaths.should.include('output.log')
|
|
|
|
})
|
|
|
|
})
|