fix: prevent flaky test on Python 3.10 in observable_test#13
Merged
Conversation
…ython 3.10 The test used time_buffered(100ms) while _test_read_until_closed sends late messages after a 100ms sleep. Both timers expire simultaneously, creating a race: the flush thread can process the late messages and close the buffered observable before read_until_closed subscribes (at t≈140ms), producing data=[]. Switch to 30ms so flush cycles land at t=30/60/90/120ms; the subscription is established at t≈49ms and the late-message flush happens at t≈120ms, after the subscriber is in place. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
knep
pushed a commit
that referenced
this pull request
May 29, 2026
Upgrades the web frontend from Vue 2 (Vue CLI + Webpack + Karma) to Vue 3 with Vite and Vitest. Integrates cleanly with PRs #11–#13 already on master (the new DateField/TimeField unit tests were migrated to Vitest as part of this merge). - Vue 3: v-model refactor, emits, lifecycle renames, Proxy reactivity (no more Vue.set/$set/$delete), :deep() selectors, Vue Router 4 + Vuex 4 - Vite build (assets in web/assets/; server web-build check updated) - Vitest + jsdom: 821 passing, 54 browser-only skips - Runtime bugs fixed: ace file-loader, v-if/v-for same element, reactive-Proxy identity (file dialog), array delete (param list), stale value-prop bindings (ScriptConfigForm, TimeField, DateField labels) - Removed vue.config.js / babel.config.js / Karma entry; CI cleanup - Verified in-browser: main + admin apps render with zero console errors Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
test_time_buffer_aggregated_read_until_closedwas failing intermittently on Python 3.10 with:Root cause
The test set up a
time_buffered(100ms)observable. The helper_test_read_until_closedsends late messages from a thread that also sleeps 100ms, then closes the source. Both timers expire at approximately the same time (~t=100ms):source_closed=True+ buffer contains late messages → flushes data, closes the buffered observablewait_buffer_flush(period×1.3+10ms = 140ms) hasn't returned yet →read_until_closedhasn't subscribed yetread_until_closedeventually subscribes (t≈140ms), the observable is already closed —subscribe()immediately callson_close()with no data →data = []Fix
Change the buffer period from 100ms → 30ms. Flush cycles now land at t=30/60/90/120ms. The subscription is established at t≈49ms (30×1.3ms+10ms), well before the late messages arrive at t=100ms. The t=120ms flush picks them up while the subscriber is already in place.
Test plan
🤖 Generated with Claude Code