File tree Expand file tree Collapse file tree
microsphere-java-core/src/test/java/io/microsphere/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,29 +244,30 @@ public void testForceDeleteOnIOException() throws Exception {
244244 AtomicInteger status = new AtomicInteger (0 );
245245
246246 executor .submit (() -> {
247+ while (status .get () != 2 ) {
248+ }
247249 synchronized (testFile ) {
248- try (FileOutputStream outputStream = new FileOutputStream (testFile , true )) {
249- outputStream .write ('a' );
250- status .set (1 );
251- executor .submit (() -> {
252- while (status .get () != 1 ) {
253- }
254- assertThrows (IOException .class , () -> forceDelete (testFile ));
255- status .set (2 );
256- return null ;
257- });
258- // wait for notification
259- testFile .wait ();
260- }
250+ testFile .notifyAll ();
261251 }
262252 return null ;
263253 });
264254
265255 executor .submit (() -> {
266- while (status .get () != 2 ) {
256+ while (status .get () != 1 ) {
267257 }
258+ assertThrows (IOException .class , () -> forceDelete (testFile ));
259+ status .set (2 );
260+ return null ;
261+ });
262+
263+ executor .submit (() -> {
268264 synchronized (testFile ) {
269- testFile .notifyAll ();
265+ try (FileOutputStream outputStream = new FileOutputStream (testFile , true )) {
266+ outputStream .write ('a' );
267+ status .set (1 );
268+ // wait for notification
269+ testFile .wait ();
270+ }
270271 }
271272 return null ;
272273 });
You can’t perform that action at this time.
0 commit comments