diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/filesystem.cpp | 13 | ||||
| -rw-r--r-- | src/zencore/jobqueue.cpp | 8 | ||||
| -rw-r--r-- | src/zencore/thread.cpp | 6 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 8e6f5085f..d18f21dbe 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -3112,15 +3112,22 @@ TEST_CASE("filesystem") { virtual void VisitFile(const std::filesystem::path& Parent, const path_view& File, uint64_t, uint32_t, uint64_t) override { - bFoundExpected |= std::filesystem::equivalent(Parent / File, Expected); + // std::filesystem::equivalent is *very* expensive on Windows, filter out unlikely candidates + if (ExpectedFilename == ToLower(std::filesystem::path(File).string())) + { + bFoundExpected |= std::filesystem::equivalent(Parent / File, Expected); + } } virtual bool VisitDirectory(const std::filesystem::path&, const path_view&, uint32_t) override { return true; } - bool bFoundExpected = false; + bool bFoundExpected = false; + + std::string ExpectedFilename; std::filesystem::path Expected; } Visitor; - Visitor.Expected = BinPath; + Visitor.ExpectedFilename = ToLower(BinPath.filename().string()); + Visitor.Expected = BinPath; FileSystemTraversal().TraverseFileSystem(BinPath.parent_path().parent_path(), Visitor); CHECK(Visitor.bFoundExpected); diff --git a/src/zencore/jobqueue.cpp b/src/zencore/jobqueue.cpp index 4aa8c113e..bd391909d 100644 --- a/src/zencore/jobqueue.cpp +++ b/src/zencore/jobqueue.cpp @@ -465,7 +465,7 @@ TEST_CASE("JobQueue") std::unique_ptr<JobQueue> Queue(MakeJobQueue(2, "queue")); WorkerThreadPool Pool(4); Latch JobsLatch(1); - for (uint32_t I = 0; I < 100; I++) + for (uint32_t I = 0; I < 32; I++) { JobsLatch.AddCount(1); Pool.ScheduleWork( @@ -479,7 +479,7 @@ TEST_CASE("JobQueue") return; } Context.ReportProgress("going to sleep", "", 100, 100); - Sleep(10); + Sleep(5); if (Context.IsCancelled()) { return; @@ -489,7 +489,7 @@ TEST_CASE("JobQueue") { zen::ThrowSystemError(8, fmt::format("Job {} forced to fail", I)); } - Sleep(10); + Sleep(5); if (Context.IsCancelled()) { return; @@ -575,7 +575,7 @@ TEST_CASE("JobQueue") RemainingJobs.size(), PendingCount, RemainingJobs.size() - PendingCount); - Sleep(100); + Sleep(5); } JobsLatch.Wait(); } diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp index b8ec85a4a..abf282467 100644 --- a/src/zencore/thread.cpp +++ b/src/zencore/thread.cpp @@ -608,12 +608,12 @@ TEST_CASE("NamedEvent") ReadyEvent.Set(); NamedEvent TestEvent(Name); - TestEvent.Wait(1000); + TestEvent.Wait(100); }); ReadyEvent.Wait(); - zen::Sleep(100); + zen::Sleep(10); TestEvent.Set(); Waiter.join(); @@ -621,7 +621,7 @@ TEST_CASE("NamedEvent") // Manual reset property for (uint32_t i = 0; i < 8; ++i) { - bool bEventSet = TestEvent.Wait(100); + bool bEventSet = TestEvent.Wait(10); CHECK(bEventSet); } } |