@@ -22,9 +22,7 @@ limitations under the License.
22
22
#include " absl/time/time.h"
23
23
#include " xla/tsl/lib/core/status_test_util.h"
24
24
#include " xla/tsl/platform/cloud/now_seconds_env.h"
25
- #include " tsl/platform/blocking_counter.h"
26
25
#include " tsl/platform/env.h"
27
- #include " tsl/platform/notification.h"
28
26
#include " tsl/platform/test.h"
29
27
30
28
namespace tsl {
@@ -493,6 +491,10 @@ TEST(RamFileBlockCacheTest, ParallelReads) {
493
491
char * buffer, size_t * bytes_transferred) {
494
492
if (counter.DecrementCount ()) {
495
493
notification.Notify ();
494
+ // This call to `Wait()` is not expected to block. Calling `Wait()` here
495
+ // allows us to satisfy `BlockingCounter`'s requirement: "When `Wait()`
496
+ // returns, it is legal to destroy the `BlockingCounter`.".
497
+ counter.Wait ();
496
498
}
497
499
if (!notification.WaitForNotificationWithTimeout (absl::Seconds (10 ))) {
498
500
// This avoids having the test time out, which is harder to debug.
@@ -524,7 +526,7 @@ TEST(RamFileBlockCacheTest, CoalesceConcurrentReads) {
524
526
// Concurrent reads to the same file blocks should be de-duplicated.
525
527
const size_t block_size = 16 ;
526
528
int num_requests = 0 ;
527
- Notification notification;
529
+ absl:: Notification notification;
528
530
auto fetcher = [&num_requests, ¬ification, block_size](
529
531
const string& filename, size_t offset, size_t n,
530
532
char * buffer, size_t * bytes_transferred) {
0 commit comments