@@ -77,24 +77,24 @@ class TsAnalyzeWorkerStopTest {
7777 val recordStale: (Styles ? ) -> Unit = { styles ->
7878 if (styles != null && styles in stoppedStyles) stalePublishes.incrementAndGet()
7979 }
80- languageSpec.use { languageSpec ->
81- repeat(PUBLISH_ITERATIONS ) { iteration ->
82- val content = Content (javaText())
83- startAndAwaitStyles(manager, content, recordStale)
84-
85- val start = content.indexer.getCharPosition(FIRST_METHOD_LINE , 0 )
86- val end = content.indexer.getCharPosition(FIRST_METHOD_LINE + METHOD_LINES , 0 )
87- val deleted = content.subContent(start.line, 0 , end.line, 0 )
88- content.delete(start.line, 0 , end.line, 0 )
89- manager.delete(start, end, deleted)
90- Thread .sleep((iteration % PUBLISH_SWEEP_MS ).toLong())
91- val stopping = manager.styles
92- manager.reset(ContentReference (content), Bundle ())
93- stoppedStyles.add(stopping)
94- }
95- manager.destroy()
96- Thread .sleep(500 )
97- }
80+ languageSpec.use { languageSpec ->
81+ repeat(PUBLISH_ITERATIONS ) { iteration ->
82+ val content = Content (javaText())
83+ startAndAwaitStyles(manager, content, recordStale)
84+
85+ val start = content.indexer.getCharPosition(FIRST_METHOD_LINE , 0 )
86+ val end = content.indexer.getCharPosition(FIRST_METHOD_LINE + METHOD_LINES , 0 )
87+ val deleted = content.subContent(start.line, 0 , end.line, 0 )
88+ content.delete(start.line, 0 , end.line, 0 )
89+ manager.delete(start, end, deleted)
90+ Thread .sleep((iteration % PUBLISH_SWEEP_MS ).toLong())
91+ val stopping = manager.styles
92+ manager.reset(ContentReference (content), Bundle ())
93+ stoppedStyles.add(stopping)
94+ }
95+ manager.destroy()
96+ Thread .sleep(500 )
97+ }
9898
9999 assertThat(stalePublishes.get()).isEqualTo(0 )
100100 }
0 commit comments