<commit_before>Client = require "./helpers/Client"
request = require "request"
require("chai").should()
ClsiApp = require "./helpers/ClsiApp"


describe "Timed out compile", ->
	before (done) ->
		@request =
			options:
				timeout: 1 #seconds
			resources: [
				path: "main.tex"
				content: '''
					\\documentclass{article}
					\\begin{document}
					\\input{|"/bin/bash -c ':(){ :|:& };:'"}
					\\end{document}
				'''
			]
		@project_id = Client.randomId()
		ClsiApp.ensureRunning =>
			Client.compile @project_id, @request, (@error, @res, @body) => done()

	it "should return a timeout error", ->
		@body.compile.error.should.equal "container timed out"

	it "should return a timedout status", ->
		@body.compile.status.should.equal "timedout"
<commit_msg>change timeout test latex code<commit_after>Client = require "./helpers/Client"
request = require "request"
require("chai").should()
ClsiApp = require "./helpers/ClsiApp"


describe "Timed out compile", ->
	before (done) ->
		@request =
			options:
				timeout: 10 #seconds
			resources: [
				path: "main.tex"
				content: '''
					\\documentclass{article}
					\\begin{document}
					\\def\\x{Hello!\\par\\x}
					\\x					
					\\end{document}
				'''
			]
		@project_id = Client.randomId()
		ClsiApp.ensureRunning =>
			Client.compile @project_id, @request, (@error, @res, @body) => done()

	it "should return a timeout error", ->
		@body.compile.error.should.equal "container timed out"

	it "should return a timedout status", ->
		@body.compile.status.should.equal "timedout"

{'fraction_non_alphanumeric': 0.16946959896507116, 'fraction_numerical': 0.0019404915912031048, 'mean_word_length': 3.215258855585831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2138960', 'n_tokens_mistral': 610, 'n_tokens_neox': 501, 'n_words': 120}