Skip to content

fix(test): table load optimization#4001

Merged
ngjaying merged 1 commit intolf-edge:masterfrom
ngjaying:jiyong/race-fixes-port
Mar 4, 2026
Merged

fix(test): table load optimization#4001
ngjaying merged 1 commit intolf-edge:masterfrom
ngjaying:jiyong/race-fixes-port

Conversation

@ngjaying
Copy link
Collaborator

@ngjaying ngjaying commented Feb 3, 2026

Changes

  • Neuron source race fix: Add syncx.RWMutex to protect concurrent access to s.cli between Subscribe and Close
  • TestWaitStopRule fix: Add wait loops to ensure rule is running before delete/stop operations
  • Table load optimization: Add TL field to RuleTest for configurable table load wait time (replaces hardcoded 100ms sleep per iteration)
  • Lookup table tests: Add TL: 500 to tests using lookup tables (TestSingleSQLRule10, TestSingleSQLRule11, TestSingleSQLRule12, TestWindowRule11)

Files Changed

File Change
internal/io/neuron/source.go Data race fix with syncx.RWMutex
internal/server/rest_test.go Wait loops before delete/stop
internal/topo/topotest/mock_topo.go TL field + sendData signature change
rule_test.go + window_rule_test.go TL: 500 for lookup table tests

Signed-off-by: Jiyong Huang [email protected]

- Add syncx.RWMutex to neuron source to fix data race
- Add wait loops in rest_test.go before delete/stop operations
- Add TL field for configurable table load wait time
- Add TL: 500 to tests using lookup tables

Signed-off-by: Jiyong Huang <[email protected]>
@ngjaying ngjaying changed the title fix(test): port race fixes and table load optimization fix(test): table load optimization Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.81%. Comparing base (5dee73c) to head (e453103).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
internal/io/neuron/source.go 94.74% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4001      +/-   ##
==========================================
- Coverage   71.87%   71.81%   -0.06%     
==========================================
  Files         460      460              
  Lines       53183    53191       +8     
==========================================
- Hits        38224    38196      -28     
- Misses      12024    12050      +26     
- Partials     2935     2945      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ngjaying ngjaying requested a review from Yisaer March 3, 2026 01:38
@ngjaying ngjaying merged commit ba3d8a3 into lf-edge:master Mar 4, 2026
61 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants