diff --git a/ddtrace/internal/runtime/runtime_metrics.py b/ddtrace/internal/runtime/runtime_metrics.py
index 1ef7c3d88..b7b2c8482 100644
--- a/ddtrace/internal/runtime/runtime_metrics.py
+++ b/ddtrace/internal/runtime/runtime_metrics.py
@@ -60,10 +60,10 @@ class RuntimeWorker(object):
 
     FLUSH_INTERVAL = 10
 
-    def __init__(self, statsd_client, flush_interval=None):
+    def __init__(self, statsd_client, flush_interval=FLUSH_INTERVAL):
         self._stay_alive = None
         self._thread = None
-        self._flush_interval = flush_interval or self.FLUSH_INTERVAL
+        self._flush_interval = flush_interval
         self._statsd_client = statsd_client
         self._runtime_metrics = RuntimeMetrics()
 
@@ -85,6 +85,10 @@ class RuntimeWorker(object):
             log.debug('Stopping {}'.format(self))
             self._stay_alive = False
 
+    def join(self, timeout=None):
+        if self._thread:
+            return self._thread.join(timeout)
+
     def _write_metric(self, key, value):
         log.debug('Writing metric {}:{}'.format(key, value))
         self._statsd_client.gauge(key, value)

tests.internal.runtime.test_runtime_metrics.TestRuntimeWorker.test_worker_metrics fails randomly
```
    def test_worker_metrics(self):
        self.tracer.configure(collect_metrics=True)
    
        with self.override_global_tracer(self.tracer):
            self.tracer._dogstatsd_client = DogStatsd()
            self.tracer._dogstatsd_client.socket = FakeSocket()
    
            root = self.start_span('parent', service='parent')
            context = root.context
            self.start_span('child', service='child', child_of=context)
    
            self.worker = RuntimeWorker(self.tracer._dogstatsd_client)
            self.worker.start()
            self.worker.stop()
    
            # get all received metrics
            received = []
            while True:
                new = self.tracer._dogstatsd_client.socket.recv()
                if not new:
                    break
    
                received.append(new)
                # DEV: sleep since metrics will still be getting collected and written
                time.sleep(.5)
    
            # expect received all default metrics
>           self.assertEqual(len(received), len(DEFAULT_RUNTIME_METRICS))
E           AssertionError: 0 != 10

tests/internal/runtime/test_runtime_metrics.py:75: AssertionError
```

https://circleci.com/gh/DataDog/dd-trace-py/114364
diff --git a/tests/internal/runtime/test_runtime_metrics.py b/tests/internal/runtime/test_runtime_metrics.py
index b2fb153ab..bd914fe73 100644
--- a/tests/internal/runtime/test_runtime_metrics.py
+++ b/tests/internal/runtime/test_runtime_metrics.py
@@ -1,5 +1,3 @@
-import time
-
 from ddtrace.internal.runtime.runtime_metrics import (
     RuntimeTags,
     RuntimeMetrics,
@@ -56,9 +54,10 @@ class TestRuntimeWorker(BaseTracerTestCase):
             context = root.context
             self.start_span('child', service='child', child_of=context)
 
-            self.worker = RuntimeWorker(self.tracer._dogstatsd_client)
+            self.worker = RuntimeWorker(self.tracer._dogstatsd_client, 0)
             self.worker.start()
             self.worker.stop()
+            self.worker.join()
 
             # get all received metrics
             received = []
@@ -68,8 +67,6 @@ class TestRuntimeWorker(BaseTracerTestCase):
                     break
 
                 received.append(new)
-                # DEV: sleep since metrics will still be getting collected and written
-                time.sleep(.5)
 
             # expect received all default metrics
             self.assertEqual(len(received), len(DEFAULT_RUNTIME_METRICS))

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest opentracing mock
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
-e git+https://github.com/DataDog/dd-trace-py.git@9bd0bd2e4b499c817492b3bf9ee4d5fba49c9751#egg=ddtrace
importlib-metadata==4.8.3
iniconfig==1.1.1
mock==5.2.0
opentracing==2.4.0
packaging==21.3
pluggy==1.0.0
psutil==7.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: dd-trace-py
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - mock==5.2.0
      - opentracing==2.4.0
      - packaging==21.3
      - pluggy==1.0.0
      - psutil==7.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/dd-trace-py

tests/internal/runtime/test_runtime_metrics.py::TestRuntimeWorker::test_worker_metrics
tests/internal/runtime/test_runtime_metrics.py::TestRuntimeTags::test_all_tags tests/internal/runtime/test_runtime_metrics.py::TestRuntimeTags::test_one_tag tests/internal/runtime/test_runtime_metrics.py::TestRuntimeMetrics::test_all_metrics tests/internal/runtime/test_runtime_metrics.py::TestRuntimeMetrics::test_one_metric
ddtrace/internal/runtime/runtime_metrics.py
ddtrace/internal/runtime/runtime_metrics.py