Commit eca86d1f authored by Mohamad Rahhal's avatar Mohamad Rahhal
Browse files

Update file test_onboarding.py

parent 37d8abe3
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -37,7 +37,22 @@ def test_scenario_onboarding(
        descriptors_file=DESCRIPTOR_FILE, context_client=context_client, device_client=device_client)
    results = descriptor_loader.process()
    check_descriptor_load_results(results, descriptor_loader)
    time.sleep(4)  
    # replace: time.sleep(4)
    def wait_for_devices(ctx, expected, timeout=20.0, interval=0.5):
        deadline = time.time() + timeout
        last = -1
        while time.time() < deadline:
            n = len(ctx.ListDevices(Empty()).devices)
            if n == expected:
                return
            last = n
            time.sleep(interval)
        raise AssertionError(f"Timeout waiting for devices: expected {expected}, got {last}")
    
    # Wait until Context service actually shows all devices, then run validate()
    wait_for_devices(context_client, descriptor_loader.num_devices)
    descriptor_loader.validate()

    descriptor_loader.validate()

    # Verify the scenario has no services/slices