Repository navigation
Commit 66016fd
committed
xds: Use real ScheduledExecutorService in ext_proc draining test to avoid FakeClock TSAN race
In ExternalProcessorClientInterceptorTest.givenDrainingStream_whenExtProcStreamCompletes_thenOnReady(),
the mock ext-proc server spawns a background thread that invokes responseObserver.onNext(),
scheduling completion tasks on scheduler. Concurrently, the test runner thread was
advancing fakeClock.forwardTime(...). Because FakeClock is not thread-safe, this
resulted in a TSAN data race on FakeClock.currentTimeNanos.
This commit replaces the FakeClock-backed scheduler with a dedicated single-thread
ScheduledExecutorService (realScheduler), configures the in-process server/channel with
directExecutor(), and relies on explicit latch synchronization instead of FakeClock
ticks, eliminating the data race.1 parent 78e1e42 commit 66016fd
1 file changed
Lines changed: 7 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7756 | 7756 | | |
7757 | 7757 | | |
7758 | 7758 | | |
| 7759 | + | |
7759 | 7760 | | |
7760 | 7761 | | |
7761 | | - | |
| 7762 | + | |
7762 | 7763 | | |
7763 | 7764 | | |
7764 | 7765 | | |
7765 | 7766 | | |
7766 | | - | |
| 7767 | + | |
7767 | 7768 | | |
7768 | 7769 | | |
7769 | 7770 | | |
7770 | | - | |
| 7771 | + | |
7771 | 7772 | | |
7772 | 7773 | | |
7773 | 7774 | | |
| |||
7806 | 7807 | | |
7807 | 7808 | | |
7808 | 7809 | | |
7809 | | - | |
7810 | | - | |
7811 | | - | |
7812 | | - | |
7813 | | - | |
7814 | | - | |
7815 | | - | |
7816 | | - | |
7817 | 7810 | | |
7818 | 7811 | | |
7819 | | - | |
7820 | | - | |
7821 | | - | |
| 7812 | + | |
7822 | 7813 | | |
7823 | 7814 | | |
7824 | 7815 | | |
7825 | 7816 | | |
7826 | | - | |
7827 | | - | |
7828 | | - | |
| 7817 | + | |
7829 | 7818 | | |
7830 | 7819 | | |
7831 | | - | |
7832 | | - | |
7833 | | - | |
7834 | | - | |
7835 | | - | |
7836 | | - | |
7837 | | - | |
7838 | | - | |
7839 | 7820 | | |
7840 | 7821 | | |
7841 | 7822 | | |
7842 | 7823 | | |
7843 | 7824 | | |
7844 | 7825 | | |
7845 | | - | |
7846 | | - | |
7847 | | - | |
7848 | 7826 | | |
7849 | | - | |
7850 | | - | |
7851 | | - | |
| 7827 | + | |
7852 | 7828 | | |
7853 | 7829 | | |
7854 | 7830 | | |
| |||
0 commit comments