Faculty of Information Technology
Software Engineering Group

Opened 19 months ago

#179 new defect

embedded debugger weird results

Reported by: Patrik Svestka Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no

Description

I have been creating a tests with mockMethod: / unmockMethod:. When I'm running just single tests the tests do not pass, but when run as run all the tests' pass. The last test does not pass when run as run all but when executed alone it does pass. I'm attaching a video to show what is exactly going on.

Today I have encountered really weird behavior, which Jan suggests could be either some kind of race condition or tests being dependent on each other.

The tests shown on videos are:

test_issue124_case1_02a
    "
    See https://swing.fit.cvut.cz/projects/stx-jv/ticket/124#comment:19
    "
    
    MessageTracer mockMethod:(UserPreferences instanceBehavior compiledMethodAt:#st80EditMode)
        do:[:state | UserPreferences current st80EditMode:true].  


    textView contents:'1234'.
    textView setCursorCol:3.
    textView selectToEndOfLine.
    self assert:textView selectionAsString = '34'.
    textView setClipboardText:'1-LINEA
2-LINEB
3-LINEC
'.
    textViewInteractor type:#Paste.
    self assert:textView selectionAsString = '1-LINEA
2-LINEB
3-LINEC
'.
    self assert:textView contents asString = ('121-LINEA
2-LINEB
3-LINEC
').
    textViewInteractor type:#Undo.
    
   MessageTracer unmockMethod:(UserPreferences instanceBehavior compiledMethodAt:#st80EditMode).

    self assert:textView contents asString = ('1234' , Character cr).

and

test_issue124_case1_02b
    "
    See https://swing.fit.cvut.cz/projects/stx-jv/ticket/124#comment:19
    "
    
    MessageTracer mockMethod:(UserPreferences instanceBehavior compiledMethodAt:#st80EditMode)
        do:[:state | UserPreferences current st80EditMode:false].  


    textView contents:'1234'.
    textView setCursorCol:3.
    textView selectToEndOfLine.
    self assert:textView selectionAsString = '34'.
    textView setClipboardText:'1-LINEA
2-LINEB
3-LINEC
'.
    textViewInteractor type:#Paste.
    self assert:textView selectionAsString = '1-LINEA
2-LINEB
3-LINEC
'.
    self assert:textView contents asString = ('121-LINEA
2-LINEB
3-LINEC
').
    textViewInteractor type:#Undo.
    MessageTracer unmockMethod:(UserPreferences instanceBehavior compiledMethodAt:#st80EditMode).

    self assert:textView contents asString = ('1234' , Character cr).

and

test_02d
    "Checking if white spaces on a blank line are preserved. Scenario:
     1) ensures trimBlankLines is set to true
     2) enter text with String crlf in the middle, which moves
        the text after crlf to next line
     3) move cursor to end first line
     4) enter white spaces
     5) move cursor to the next line
     6) press backspace
     7) assert: that textView contents returns a text 
        disregarding the white spaces entered"

    |wasOn|

    MessageTracer mockMethod:(UserPreferences instanceBehavior compiledMethodAt:#trimBlankLines)
        do:[:state | UserPreferences current trimBlankLines:true].

    textView contents:'This text is to', String crlf, 'continue'.

    wasOn := textView hideCursor.
    textView setCursorLine:1.
    textView setCursorCol:16.
    wasOn ifTrue:[
        textView showCursor
    ].

    textViewInteractor type: Character space.
    textViewInteractor type: Character space.
    textViewInteractor type: Character space.

    wasOn := textView hideCursor.
    textView setCursorLine:2.
    textView setCursorCol:1.
    wasOn ifTrue:[
        textView showCursor
    ].

    textViewInteractor type: #BackSpace.

    MessageTracer unmockMethod:(UserPreferences instanceBehavior compiledMethodAt:#trimBlankLines).

    self assert:textView contents asString = ('This text is tocontinue', String crlf).

Attachments (1)

sometimes_failing_tests_sometimes_not.mp4 (3.2 MB) - added by Patrik Svestka 19 months ago.
Showcase of failing tests

Download all attachments as: .zip

Change History (1)

Changed 19 months ago by Patrik Svestka

Showcase of failing tests

Note: See TracTickets for help on using tickets.