TimeoutTests.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import Client from './helpers/Client.js'
  2. import ClsiApp from './helpers/ClsiApp.js'
  3. import { expect } from 'chai'
  4. describe('Timed out compile', function () {
  5. before(async function () {
  6. this.request = {
  7. options: {
  8. timeout: 10,
  9. }, // seconds
  10. resources: [
  11. {
  12. path: 'main.tex',
  13. content: `\
  14. \\documentclass{article}
  15. \\begin{document}
  16. \\def\\x{Hello!\\par\\x}
  17. \\x
  18. \\end{document}\
  19. `,
  20. },
  21. ],
  22. }
  23. this.project_id = Client.randomId()
  24. await ClsiApp.ensureRunning()
  25. this.body = await Client.compile(this.project_id, this.request)
  26. })
  27. it('should return a timeout error', function () {
  28. this.body.compile.error.should.equal('container timed out')
  29. })
  30. it('should return a timedout status', function () {
  31. this.body.compile.status.should.equal('timedout')
  32. })
  33. it('should return isInitialCompile flag', function () {
  34. expect(this.body.compile.stats.isInitialCompile).to.equal(1)
  35. })
  36. it('should return the log output file name', function () {
  37. const outputFilePaths = this.body.compile.outputFiles.map(x => x.path)
  38. outputFilePaths.should.include('output.log')
  39. })
  40. })