           presenter = buildPresenter(explicitHeight: 30, scrollTop: 20, tileSize: 2)
 
           marker = editor.markBufferPosition([2, 2])
-          highlight = editor.decorateMarker(marker, type: 'highlight', class: 'a')
-          waitsForStateToUpdate presenter, ->
+          highlight = null
+          waitsForStateToUpdateAsync presenter, ->
+            highlight = editor.decorateMarker(marker, type: 'highlight', class: 'a')
             marker.setBufferRange([[2, 2], [5, 2]])
             highlight.flash('b', 500)
           runs ->

            blockDecorationsHeight = Math.round(35.8 + 100.3 + 95.2)
            expect(getStylesForGutterWithName(presenter, 'line-number').scrollHeight).toBe(linesHeight + blockDecorationsHeight)

            waitsForStateToUpdate presenter, -> blockDecoration3.destroy()
            runs ->
              blockDecorationsHeight = Math.round(35.8 + 100.3)
              expect(getStylesForGutterWithName(presenter, 'line-number').scrollHeight).toBe(linesHeight + blockDecorationsHeight)

                expect(lineStateForScreenRow(presenter, 6).decorationClasses).toEqual ['a', 'b']
                expect(lineStateForScreenRow(presenter, 7).decorationClasses).toBeNull()

              waitsForStateToUpdateAsync presenter, -> marker1.setBufferRange([[2, 0], [4, 2]])
              runs ->
                expect(lineStateForScreenRow(presenter, 1).decorationClasses).toBeNull()
                expect(lineStateForScreenRow(presenter, 2).decorationClasses).toEqual ['a']
