samples icon indicating copy to clipboard operation
samples copied to clipboard

Re-add Craig Labenz's code sharing sample

Open domesticmouse opened this issue 3 years ago • 2 comments

This reverts commit dc50c46ef13c08feb4e4b588101ca70acf840305.

domesticmouse avatar Oct 08 '22 12:10 domesticmouse

Hey @craiglabenz can you explain the following?

== Testing 'code_sharing/server' on Flutter's stable channel ==
/d/a/samples/samples/code_sharing/server /d/a/samples/samples
Running "flutter pub get" in server...                             78.0s
Analyzing server...
No issues found!
Formatted 7 files (0 changed) in 0.36 seconds.

00:00 +0: loading D:\a\samples\samples\code_sharing\server\test\server_test.dart                                                                                                                       
00:01 +0: loading D:\a\samples\samples\code_sharing\server\test\server_test.dart                                                                                                                       
00:02 +0: loading D:\a\samples\samples\code_sharing\server\test\server_test.dart                                                                                                                       
00:02 +0: Increment                                                                                                                                                                                    
00:03 +0: Increment                                                                                                                                                                                    
00:03 +0 -1: Increment [E]                                                                                                                                                                             
  A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
  
  package:http/src/io_client.dart 88:7  IOClient.send
  

To run this test again: C:\hostedtoolcache\windows\flutter\stable-3.3.4-x64\bin\cache\dart-sdk\bin\dart.exe test D:\a\samples\samples\code_sharing\server\test\server_test.dart -p vm --plain-name 'Increment'

00:03 +0 -1: Get                                                                                                                                                                                       
00:04 +0 -1: Get                                                                                                                                                                                       
00:05 +0 -1: Get                                                                                                                                                                                       
00:05 +0 -2: Get [E]                                                                                                                                                                                   
  A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
  
  package:http/src/io_client.dart 88:7  IOClient.send

domesticmouse avatar Oct 08 '22 12:10 domesticmouse

PTAL @craiglabenz

domesticmouse avatar Oct 12 '22 02:10 domesticmouse

These tests continue to pass on my development machine - there must be permissions or other environmental differences between my machine and CI. The failing tests are integration tests - they actually launch a process to run the server and connect to it. Maybe we need to be more delicate around this with CI? (Or I need to rethink the testing strategy for this sample?)

craiglabenz avatar Oct 17 '22 16:10 craiglabenz

I've no preference either way. Even just skip: true with a comment about windows CI failing

domesticmouse avatar Oct 17 '22 18:10 domesticmouse

Opting out only on Windows. Seems like we might finally have it right, @domesticmouse?

craiglabenz avatar Oct 17 '22 19:10 craiglabenz

Looks good to me. Feel free to lgtm and land this PR

domesticmouse avatar Oct 18 '22 00:10 domesticmouse