test: fix flaky app/fiber_channel test
The test has three known failures: 1. Happens, because the test doesn't wait for a cancelled fiber to exit. As a result, it keeps reading from the test channel. Fix this by waiting for the test fiber to be dead for sure. ``` --- app/fiber_channel.result Sun Apr 26 17:45:32 2020 +++ var/050_app/fiber_channel.result Tue May 12 05:10:14 2020 @@ -200,381 +200,14 @@ ... ch:count() --- -- 1 +- 0 ... ch:is_full() --- -- true +- false ... ch:is_empty() --- -- false +- true ... ch:get(box.info.pid) == box.info.pid ``` 2. The test writes 16 values to a table, but waits for only 15 values. Fix this and also cancel test fibers before proceeding to the next test case. ``` --- app/fiber_channel.result Fri Feb 21 11:21:32 2020 +++ var/049_app/fiber_channel.result Tue May 12 01:05:37 2020 @@ -346,7 +346,6 @@ - 42 - 43 - 44 - - 45 ... ch = fiber.channel(1) --- ``` 3. The test uses a 100 iteration loop to wait for a condition to become true. If the host is busy, 100 may be not enough. Let's use test_run:wait_cond() instead - it's more reliable. ``` --- app/fiber_channel.result Fri Feb 21 12:08:07 2020 +++ app/fiber_channel.reject Fri May 8 08:20:52 2020 @@ -487,7 +487,7 @@ ... count > 2000, #test_res, test_res; --- -- true +- false - 10 unit/fiber_channel.test [ pass ] - - true - true ``` Closes #4961
Loading
Please register or sign in to comment