Androidtest#268
Open
Ethran wants to merge 5 commits into
Open
Conversation
GlobalAppSettingsConcurrencyTest, SnapshotStateMapConcurrencyTest: add synchronization to background writers to prevent SnapshotApplyConflictException while validating concurrent reader stability.
EditorViewModel: ensure selection state reset occurs on the Main thread to avoid concurrent change exceptions during composition. TestNotebookSeeder: add utility to programmatically seed notebooks and strokes for deterministic testing. TestDatabaseFactory: add helper for creating in-memory or asset-based test databases. EditorUnsupportedConcurrentChangeTests: add regression tests to detect off-main-thread writes to selection state. MigrationTest: improve resource management and column lookup in database migration tests. Add comprehensive documentation for testing with real and seeded databases. Update existing instrumentation tests with timeouts and add necessary test dependencies.
| implementation 'androidx.fragment:fragment-ktx:1.8.9' | ||
| implementation 'androidx.graphics:graphics-core:1.0.4' | ||
| implementation 'androidx.input:input-motionprediction:1.0.0' | ||
| implementation 'androidx.test.ext:junit-ktx:1.3.0' |
Comment on lines
+4
to
+6
| <activity | ||
| android:name="com.ethran.notable.testing.TestActivity" | ||
| android:exported="true" /> |
Comment on lines
+92
to
+95
| start.countDown() | ||
| writersDone.await(30, TimeUnit.SECONDS) | ||
| readerDone.await(30, TimeUnit.SECONDS) | ||
| pool.shutdownNow() |
Comment on lines
+139
to
+141
| start.countDown() | ||
| done.await(30, TimeUnit.SECONDS) | ||
| pool.shutdownNow() |
Comment on lines
+85
to
+88
| start.countDown() | ||
| writersDone.await(30, TimeUnit.SECONDS) | ||
| readerDone.await(30, TimeUnit.SECONDS) | ||
| pool.shutdownNow() |
Comment on lines
+155
to
+156
| val watchedStates = viewModel.selectionState.snapshotDelegateStatesForTest() | ||
| android.util.Log.d(LOG_TAG, "Watching ${watchedStates.size} state objects") |
Comment on lines
+25
to
+28
| Pros: | ||
| - 100% deterministic | ||
| - Fast | ||
| - No need to keep binary files in the repo |
| ) | ||
|
|
||
| /** | ||
| * Simple, deterministic data seeder for tests. |
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.
No description provided.