This is a cleanup CL to apply your suggestion for my CL from yesterday to the rest of /remoting. There are a few other changes where instances of 'RunUntilIdle' and similar constructs were replaced to reduce flakiness.
PTAL!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Thanks for cleaning this up!
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();It looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
Yeah I'll add comments and also run the tests 100 times to look for timing flakes
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();Joe DowningIt looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
Yeah I'll add comments and also run the tests 100 times to look for timing flakes
Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();Joe DowningIt looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
Joe DowningYeah I'll add comments and also run the tests 100 times to look for timing flakes
Comment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.
This file doesn't seem to be changed between patch 8 and 11?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks!
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();Joe DowningIt looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
Joe DowningYeah I'll add comments and also run the tests 100 times to look for timing flakes
Yuwei HuangComment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.
This file doesn't seem to be changed between patch 8 and 11?
Oops, you're right, I thought I had added it but the comment already indicated what RunUntil was doing so I left it. It turns out this isn't being on an arbitrary thread. It is being run on the main thread. So basically RunUntil is flushing the tasks and then the RunsTaskInCurrentSequence call succeeds immediately and returns.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Updating old tests to use RunOnceCallback and TestFuture
Applying CR feedback I received yesterday for a signaling unit test
to the rest of remoting.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
return environment_.GetMainThreadTaskRunner()
->RunsTasksInCurrentSequence();Joe DowningIt looks like the lambda is run on an arbitrary thread and you are just waiting for it to be the main thread. It's not clear why the lambda being run on the main thread means all tasks have been proceeded. Could you add some comment to explain this?
Joe DowningYeah I'll add comments and also run the tests 100 times to look for timing flakes
Yuwei HuangComment added but basically this is the new way to 'RunUntilIdle' as RunUntil has updated semantics to allow pending or recently posted tasks to be executed which are more robust that the previous way.
Joe DowningThis file doesn't seem to be changed between patch 8 and 11?
Oops, you're right, I thought I had added it but the comment already indicated what RunUntil was doing so I left it. It turns out this isn't being on an arbitrary thread. It is being run on the main thread. So basically RunUntil is flushing the tasks and then the RunsTaskInCurrentSequence call succeeds immediately and returns.
Thinking about this more, I want to revisit it as there is probably a more intuitive mechanism. Each time I tweak a file, Gerrit removes the +1 so it's faster to iterate on it separately.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |