Repository navigation
Updated unit tests - #11
Merged
Merged
Conversation
Several fixes so the server-spinning suites are deterministic under swift-testing's in-process parallelism: - UDP mock parks instead of spinning (a per-server 10Hz wake starved the cooperative pool when many ran at once). - Unique server ports from the registry (random ports birthday-collide across a full run and silently overwrite each other's listeners). - A shared SerialGate serializes server-spinning tests. - connect() fails fast (5s) and retries: the in-memory socket has a rare handshake lost-wakeup that a fresh socket pair sidesteps. - Loopback suites route through the same retrying connect. Full suite is green across repeated runs (~12s).
GunBound view-model networking coverage lifted overall libs to ~73%.
A shared ScreenHarness (fake-texture renderer + nonexistent-asset ClientContext + silent audio) drives each GameScreen through onEnter -> render -> a spread of input events -> update -> render. Lifts GunBoundClient from 37% to 65% by exercising the screens' layout and draw code, which had no coverage at all.
Tests the factory maps every mode to a screen, and drives the state machine through boot, transitions to every screen (arming the wipe), input/gamepad forwarding, and render.
Runs aim/walk/weapon/charge/fire across several turns plus chat, a relayed action, and a death, rendering every frame — covering the screen's phase-dependent draw code and the underlying simulation.
Covers the screen and embedded-widget draw branches the default smoke pass leaves untouched: populated room/server lists, open Create Room and buddy panels, avatar catalog selection + try-on + tab switches, and a seeded Ready Room roster.
Tests every ClientMode's description/rawValue/round-trip and the Mobile(argument:) parser (valid, unknown-number, non-number).
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI intermittently fails with
timeout(nonceResponse)after 30s — e.g. the0.3.2tag run of the PR #10 merge. The view-model networking suites added in PR #10 spin up in-memory servers/clients that swift-testing runs in parallel in-process, and two issues made them flaky: the stabilization commits didn't make it into the PR #10 merge, somainhas the tests without the fixes.Fix
SerialGateserializes the server-spinning tests.connect()fails fast (5s) and retries — the in-memory socket has a rare handshake lost-wakeup that a fresh socket pair sidesteps; retrying avoids the 30s request-timeout hang. Loopback suites route through the same retrying connect.Test plan
swift testgreen across repeated local runs (~12s each, previously flaked ~1-in-4)