Problem with Spec Test in Weblab

sim
Windoof-User
Windoof-User
Beiträge: 34
Registriert: 6. Apr 2012 20:24

Problem with Spec Test in Weblab

Beitrag von sim »

Hi,

when I run the Spec Test for Assignment 04: LetRec with substitution, I get a RunningFailure. I've been running into this Failure previously, but the last time the error was that my Test class name was not matching the //test: Test comment in the first line. But this time the failure occurs in the Spec Test, so the error is not because I have accidental renamed the Test class.

Is this my fault or is the Spec Test erroneous?

Thanks in advance,
Simon

IvaToteva
Neuling
Neuling
Beiträge: 10
Registriert: 15. Apr 2015 16:41

Re: Problem with Spec Test in Weblab

Beitrag von IvaToteva »

Hi,

This time there is nothing wrong with Spec Test.

A RunningFailure can also indicate that an exception is thrown during the execution of the tests. This is also the case with your solution, so you should look into your implementation.

Kind regards,
Iva

Toa
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 121
Registriert: 16. Feb 2011 23:58

Re: Problem with Spec Test in Weblab

Beitrag von Toa »

Just a guess, but maybe you are running in a endless recursion.

kbraden
Mausschubser
Mausschubser
Beiträge: 98
Registriert: 15. Okt 2010 20:35

Re: Problem with Spec Test in Weblab

Beitrag von kbraden »

I seem to have a similar problem: spec-test says "RunningFailure" almost immediately. However, when I deliberately produce an infinite recursion in my own tests, it runs for a few minutes and then says "Killed". Any hints?

Talaron
Mausschubser
Mausschubser
Beiträge: 85
Registriert: 26. Apr 2012 11:34

Re: Problem with Spec Test in Weblab

Beitrag von Talaron »

A RunningFailure is almost definitely a sign of an infinite recursion.

The difference to your example could be that for actual endless recursion, a stack overflow will happen after a few milliseconds that causes an exception. Scala however optimizes tail recursion (a recursive call that is the last statement, like "def x : Int = x") into a simple loop, which will then only terminate after a timeout.

//EDIT: The relevant test case was altered. Please see the newly created forum thread for details!

Antworten

Zurück zu „Archiv“