You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encounter the strangest problem: in a project (from a student I supervise), I can never reach the end of the execution of his alsatian test suite.
At first I tried with:
alsatian './src/test/ts/*.spec.ts'
And it got stuck, then I tried with a timeout:
alsatian -t 1000 './src/test/ts/*.spec.ts'
But it also got stuck.
Then I played with the debugger, and I found out that alsatian was stuck inside this test case:
@Test("A Queen can move vertically")testCanMoveVertically(){// Check the following moves are possible: moveE4_E1, moveE4_E8letpositionE1 : Position=position(4,0);letpositionE8 : Position=position(4,7);Expect((isPossible.queenMove(chessboard,move(positionInitiale,positionE1)))&&(isPossible.queenMove(chessboard,move(positionInitiale,positionE8)))).toBeTruthy();}
More precisely, it got stuck inside the queenMove call − itself inside the Expect − because of the faulty while loop it contains (which will be infinite in this case):
exportfunctionqueenMove(board: Chessboard,move: Move): boolean{letchemin : Square=squareAtPosition(board,move.from!);//TODO: resuodre le probleme d'arret de boucle lié a chemin.isEmpty//validation mouvement rankif(move.from!.rank!=move.to!.rank&&move.from!.file==move.to!.file){while(chemin.position!=move.to!&&(squareAtPosition(board,position(chemin.position.file,chemin.position.rank+1)).isEmpty||squareAtPosition(board,position(chemin.position.file,chemin.position.rank-1)).isEmpty)){if(chemin.position.rank<move.to!.rank){chemin.position.rank++;}else{chemin.position.rank--;}}…
I believe alsatian should stop after the given timeout in this situation?
The text was updated successfully, but these errors were encountered:
@ebousse good find I would imagine this is because the main thread is being locked by the test. I was playing with pushing the running of tests to a worker thread so this could resolve the issue. I'll see if I can have an investigate in scope of 4.0.0 work :)
I encounter the strangest problem: in a project (from a student I supervise), I can never reach the end of the execution of his alsatian test suite.
At first I tried with:
And it got stuck, then I tried with a timeout:
But it also got stuck.
Then I played with the debugger, and I found out that alsatian was stuck inside this test case:
More precisely, it got stuck inside the
queenMove
call − itself inside theExpect
− because of the faulty while loop it contains (which will be infinite in this case):I believe alsatian should stop after the given timeout in this situation?
The text was updated successfully, but these errors were encountered: