Fix flaky-test testWriteSetWriteableCheck#3555
Conversation
|
ping @dlg99 @zymap @eolivelli @hangc0276 @StevenLuMT PTAL. Thanks. |
|
@wenbingshen Do you know what broke the test? I believe it was passing / not flaking on the CI. |
@dlg99 Thanks for your comments. I've documented in my notes the failure of testWriteSetWriteableCheck in the following CI test, check it out: As you can see it often fails. Likewise, when I tested my local, I ran 10 times and failed 7 times.
Please check the picture below: I printed the log before and after setting the channel |
### Motivation `testWriteSetWriteableCheck` always failed. After investigation, it is found that `isWritable=false` is set when the simulated channel is not writable, but the unit test cannot fully perceive the channel establishment, because the channel is completely established asynchronously. The isWritable state of false is changed to true again. you can see the following logs:  The smallest change is that we can ensure that the channel is established before changing the channel state, such as executing `bkc.getBookieInfo()`, and then `setTargetChannelState` (cherry picked from commit c76e549)
### Motivation `testWriteSetWriteableCheck` always failed. After investigation, it is found that `isWritable=false` is set when the simulated channel is not writable, but the unit test cannot fully perceive the channel establishment, because the channel is completely established asynchronously. The isWritable state of false is changed to true again. you can see the following logs:  The smallest change is that we can ensure that the channel is established before changing the channel state, such as executing `bkc.getBookieInfo()`, and then `setTargetChannelState`


Motivation
testWriteSetWriteableCheckalways failed. After investigation, it is found thatisWritable=falseis set when the simulated channel is not writable, but the unit test cannot fully perceive the channel establishment, because the channel is completely established asynchronously. The isWritable state of false is changed to true again.you can see the following logs:

The smallest change is that we can ensure that the channel is established before changing the channel state, such as executing
bkc.getBookieInfo(), and thensetTargetChannelState